February 2022
Intermediate to advanced
274 pages
6h 28m
English
We can combine markers and use a bit of logic to help select tests, just like we did with -k keywords in Using Keywords to Select Test Cases.
We can run the “finish” tests that deal with exceptions with -m "finish and exception":
| | $ pytest -v -m "finish and exception" |
| | ========================= test session starts ========================== |
| | collected 12 items / 11 deselected / 1 selected |
| | |
| | test_finish.py::test_finish_non_existent PASSED [100%] |
| | |
| | =================== 1 passed, 11 deselected in 0.01s =================== |
We can find all the finish tests that are not included in the smoke tests:
| | $ pytest -v -m "finish and not smoke" |
| | ========================= ... |
Read now
Unlock full access