pytest: add page (#9539)

pull/1/head
Hugh Wimberly 2022-11-26 00:54:27 -08:00 committed by GitHub
parent 3e13850ea4
commit 519c7b04b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 0 deletions

28
pages/common/pytest.md Normal file
View File

@ -0,0 +1,28 @@
# pytest
> Run Python tests.
> More information: <https://docs.pytest.org/>.
- Run tests from specific files:
`pytest {{path/to/test_file1.py path/to/test_file2.py ...}}`
- Run tests with names matching a specific [k]eyword expression:
`pytest -k {{expression}}`
- Exit as soon as a test fails or encounters an error:
`pytest --exitfirst`
- Run tests matching or excluding markers:
`pytest -m {{marker_name1 and not marker_name2}}`
- Run until a test failure, continuing from the last failing test:
`pytest --stepwise`
- Run tests without capturing output:
`pytest --capture=no`