February 2022
Intermediate to advanced
274 pages
6h 28m
English
In the previous section we saw how using -e py310 enables us to zoom in on one environment to run. We could also zoom in on an individual test if we make one more modification to allow parameters to get to pytest.
The changes are as simple as adding {posargs} to our pytest command:
| | [testenv] |
| | deps = |
| | pytest |
| | faker |
| | pytest-cov |
| | commands = |
| | pytest --cov=cards --cov=tests --cov-fail-under=100 {posargs} |
Then to pass arguments to pytest, add a -- between the tox arguments and the pytest arguments. In this case, we’ll select test_version tests using keyword flag -k. We’ll also use --no-cov to turn off coverage (no point in measuring coverage when we’re only running ...
Read now
Unlock full access