node ID
The full address pytest gives each test, made of the file path, two colons and the test name, such as test_discount.py::test_a_silly_percentage_is_refused.
In more detail
Verbose output prints one per test, and pasting it back onto the command line runs just that test. Parametrized cases add their case ID in square brackets, so quote the node ID in the shell.
Example
pytest "test_discount.py::test_a_tenth_off[half-penny]"Related terms
- pytest -v — The pytest option that prints each test's node ID and result on its own line instead of one dot per test.
- parametrized test — One test function run many times with different data, each run reported as a separate test case.
- identifier — A name or number that picks out exactly one thing, such as one container, one image or one database row.
Taught in
- Introducing pytest — Automated Testing, TDD & Quality Engineering
- Parametrised Tests — Automated Testing, TDD & Quality Engineering
- Naming Tests For Readability — Automated Testing, TDD & Quality Engineering