From 519c7b04b1f2be4502d4a2f76a6cf1d7d15a5326 Mon Sep 17 00:00:00 2001 From: Hugh Wimberly Date: Sat, 26 Nov 2022 00:54:27 -0800 Subject: [PATCH] pytest: add page (#9539) --- pages/common/pytest.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pages/common/pytest.md diff --git a/pages/common/pytest.md b/pages/common/pytest.md new file mode 100644 index 0000000000..d947609600 --- /dev/null +++ b/pages/common/pytest.md @@ -0,0 +1,28 @@ +# pytest + +> Run Python tests. +> More information: . + +- 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`