diff --git a/_static/pyos.css b/_static/pyos.css index 4c8bc580..0de8f663 100644 --- a/_static/pyos.css +++ b/_static/pyos.css @@ -21,6 +21,13 @@ /* anything related to the dark theme */ html[data-theme="dark"] { --pst-color-info-bg: #400f59!important; + --pst-color-tbl-row: #2E2E2E!important; +} + +/* anything related to the light theme */ +html[data-theme="light"] { + --pst-color-tbl-row: #E1DEE9!important; +} } @@ -331,3 +338,45 @@ aside.footnote { background-color: var(--pst-color-target); } } + +.fa-circle-check { + color: #49b7b9; +} + +/* pyOpenSci table styles */ + +.pyos-table { + & th.head, .pyos-table th.head.stub { + background-color: #33205C!important; + + & p { + color: #fff + } +} + & th.stub { + background-color: var(--pst-color-tbl-row); + font-weight: 500; + } + & td { + vertical-align: middle; + text-align: center; + } +} + + +/* Make the first column in a table a "header" like thing */ + + +/* Dark mode fix for tables */ +@media (prefers-color-scheme: dark) { + td:not(.row-header):nth-child(1) { + background-color: var(--pst-color-tbl-row); /* Adjust the dark mode color */ + color: #ffffff; /* Adjust the text color for better contrast */ + font-weight: 500; + } + } + +td, th { + border: 1px solid #ccc; /* Light gray border */ + padding: 8px; /* Add some padding for better readability */ + } diff --git a/images/python-package-test-tools.png b/images/python-package-test-tools.png deleted file mode 100644 index 9f352add..00000000 Binary files a/images/python-package-test-tools.png and /dev/null differ diff --git a/tests/run-tests.md b/tests/run-tests.md index b9f23463..edaeead0 100644 --- a/tests/run-tests.md +++ b/tests/run-tests.md @@ -19,15 +19,51 @@ There are three types of tools that will make is easier to setup and run your te 2. **Automation tools** allow you to automate running workflows such as tests in specific ways using user-defined commands. For instance it's useful to be able to run tests across different Python versions with a single command. Tools such as [**nox**](https://nox.thea.codes/en/stable/index.html) and [**tox**](https://tox.wiki/en/latest/index.html) also allow you to run tests across Python versions. However, it will be difficult to test your build on different operating systems using only nox and tox - this is where continuous integration (CI) comes into play. 3. **Continuous Integration (CI):** is the last tool that you'll need to run your tests. CI will not only allow you to replicate any automated builds you create using nox or tox to run your package in different Python environments. It will also allow you to run your tests on different operating systems (Windows, Mac and Linux). [We discuss using CI to run tests here](tests-ci). -:::{figure-md} -![Figure showing three boxes - the first has Test Frameworks in it, the second Test Runner and the third Continuous Integration....](../images/python-package-test-tools.png) - -There are three types of tools that will help you develop and run your tests. Test frameworks like pytest -provide syntax and a **framework** for you to write and -run tests. Test runners automate processes such as creating isolated environments to run your tests in, and running tests across Python versions with a single command. Finally Continuous integrate (CI) is a generic platform where you can run your tests across operating systems. CI allows you to run your tests on every PR and commit to ensure iterative checks as contributors suggest changes to your code. - +:::{list-table} Table: Testing & Automation Tool +:widths: 40 15 15 15 15 +:header-rows: 1 +:align: center +:stub-columns: 1 +:class: pyos-table + +* - Features + - Testing Framework (pytest) + - Test Runner (Tox) + - Automation Tools (Nox) + - Continuous Integration (GitHub Actions) +* - Run Tests Locally + - + - + - + - +* - Run Tests Online + - + - + - + - +* - Run Tests Across Python Versions + - + - + - + - +* - Run Tests In Isolated Environments + - + - + - + - +* - Run Tests Across Operating Systems (Windows, MacOS, Linux) + - + - + - + - +* - Use for other automation tasks (e.g. building docs) + - + - + - + - ::: + ## What testing framework / package should I use to run tests? We recommend using `Pytest` to build and run your package tests. Pytest is the most common testing tool used in the Python ecosystem.