Link Search Menu Expand Document


Run Python tests. More information:

  • Run tests from specific files:

pytest {{path/to/ path/to/ ...}}

  • 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