You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/run-tests.md
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,8 @@ Python versions.
18
18
19
19
### Tools to run your tests
20
20
21
-
There are three types of tools that will make is easier to setup and run your tests in various environments:
21
+
There are three categories of tools that will make is easier to setup
22
+
and run your tests in various environments:
22
23
23
24
1. A **test framework**, is a package that provides a particular syntax and set of tools for _both writing and running your tests_. Some test frameworks also have plugins that add additional features such as evaluating how much of your code the tests cover. Below you will learn about the **pytest** framework which is one of the most commonly used Python testing frameworks in the scientific ecosystem. Testing frameworks are essential but they only serve to run your tests. These frameworks don't provide a way to easily run tests across Python versions without the aid of additional automation tools.
24
25
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.
@@ -104,12 +105,13 @@ Python environment you currently have activated. This means that tests will be
104
105
run on a single version of Python and only on the operating system that you
105
106
are running locally.
106
107
107
-
This is a great start to making your Python package more robust! However, your users may be using your package on different
108
-
versions of Python. Or they also may use other operating systems.
109
-
110
108
An automation tool can simplify the process of running tests
111
109
in various Python environments.
112
110
111
+
:::{admonition} Tests across operating systems
112
+
If you want to run your tests across different operating systems you can [continuous integration. Learn more here](tests-ci).
113
+
:::
114
+
113
115
### Tools to automate running your tests
114
116
115
117
To run tests on various Python versions or in various specific environments with a single command, you can use an automation tool such as `nox` or `tox`.
@@ -144,7 +146,9 @@ single command.
144
146
145
147
:::{note} Nox Installations
146
148
147
-
When you use nox to run tests across different Python versions, nox will create and manage individual `venv` environments for each Python version that you specify in the nox function. It will setup everything that you need to run tests in each environment for you.
149
+
When you install and use nox to run tests across different Python versions, nox will create and manage individual `venv` environments for each Python version that you specify in the nox function.
150
+
151
+
Nox will manage each environment on it's own.
148
152
:::
149
153
150
154
Nox can also be used for other development tasks such as building
Copy file name to clipboardExpand all lines: tests/tests-ci.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,11 @@ Running your [test suite locally](run-tests) is useful as you develop code and a
4
4
5
5
CI can also be triggered for pull requests and pushes to your repository. This means that every pull request that you, your maintainer team or a contributor submit, can be tested. In the end CI testing ensures your code continues to run as expected even as changes are made to the code base.
6
6
7
+
::::{todo}
7
8
```{note}
8
9
[Learn more about Continuous Integration and how it can be used, here.](ci)
0 commit comments