Skip to content

Instantly share code, notes, and snippets.

@strokirk
Last active November 23, 2020 16:14
Show Gist options
  • Select an option

  • Save strokirk/2fe45a893684d78fed73d0666048da99 to your computer and use it in GitHub Desktop.

Select an option

Save strokirk/2fe45a893684d78fed73d0666048da99 to your computer and use it in GitHub Desktop.
usage: pytest [options] [file_or_dir] [file_or_dir] [...]
positional arguments:
file_or_dir
-s, --show-output Show print and stdio output as it happens.
-x, --exitfirst Exit instantly on first error or failed test.
-k EXPRESSION Only run tests matching the [substring EXPRESSION]. example: -k 'bla and not bla2'
-m MARKEXPR Only run tests matching the [mark EXPRESSION]. example: -m 'mark1 and not mark2'.
--maxfail=num Exit after first num failures or errors.
-c file load configuration from `file`.
--cache-clear remove all cache contents at start of test run.
-v, --verbose increase verbosity.
-q, --quiet decrease verbosity.
-l, --showlocals show locals in tracebacks (disabled by default).
--tb=style traceback print mode (auto/long/short/line/native/no).
--durations=N show N slowest setup/test durations (N=0 for all).
--version display pytest lib version and import information.
--full-help show help message and configuration info
-h, --help show help message and configuration info
--pdb Start the interactive Python debugger on errors
--trace Immediately break when running each test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment