Skip to content

Commit 2442e98

Browse files
committed
Fix: edits from @WillInc @ucodery
1 parent 4a99523 commit 2442e98

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

tests/run-tests.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Python versions.
1818

1919
### Tools to run your tests
2020

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:
2223

2324
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.
2425
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
104105
run on a single version of Python and only on the operating system that you
105106
are running locally.
106107

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-
110108
An automation tool can simplify the process of running tests
111109
in various Python environments.
112110

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+
113115
### Tools to automate running your tests
114116

115117
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.
144146

145147
:::{note} Nox Installations
146148

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.
148152
:::
149153

150154
Nox can also be used for other development tasks such as building
@@ -249,7 +253,7 @@ def test_mamba(session):
249253
"""
250254

251255
# Install dev requirements
252-
session.install(".[tests]")
256+
session.conda_install(".[tests]")
253257
# Run tests using any parameters that you need
254258
session.run("pytest")
255259
```

tests/tests-ci.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ Running your [test suite locally](run-tests) is useful as you develop code and a
44

55
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.
66

7+
::::{todo}
78
```{note}
89
[Learn more about Continuous Integration and how it can be used, here.](ci)
910
```
11+
::::
1012

1113
## CI & pull requests
1214

0 commit comments

Comments
 (0)