mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-19 08:50:10 +00:00
Update cheatsheets
This commit is contained in:
33
pytest
Normal file
33
pytest
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# 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`
|
||||
Reference in New Issue
Block a user