Forrest logo
back to context overview

pytest

List of commands for pytest:

  • pytest:tldr:18482 pytest: Run until a test failure, continuing from the last failing test.
    $ pytest --stepwise
    try on your machine
    explain this command
  • pytest:tldr:4544d pytest: Run tests matching or excluding markers.
    $ pytest -m ${marker_name1 and not marker_name2}
    try on your machine
    explain this command
  • pytest:tldr:b528d pytest: Run tests from specific files.
    $ pytest ${path-to-test_file1-py path-to-test_file2-py ---}
    try on your machine
    explain this command
  • pytest:tldr:b5b3b pytest: Run tests with names matching a specific [k]eyword expression.
    $ pytest -k ${expression}
    try on your machine
    explain this command
  • pytest:tldr:cc519 pytest: Run tests without capturing output.
    $ pytest --capture=no
    try on your machine
    explain this command
  • pytest:tldr:f67e8 pytest: Exit as soon as a test fails or encounters an error.
    $ pytest --exitfirst
    try on your machine
    explain this command
back to context overview