Structure some of the tests you have written by placing them in a class.
Make sure the name of the class starts with the word Test.
Indent your test functions so that they belong to the class.
Add self as the first parameter of each function:
class TestDummy:
def test_dummy(self):
assert ...Run all tests written so far by simply typing
python -m pytestRun only one test file:
python -m pytest FILE_NAMERun only one test class:
pytest -m pytest FILE_NAME::CLASS_NAMEFinally, run a single test:
pytest -m pytest FILE_NAME::CLASS_NAME::TEST_NAMEFind out which options of pytest do the following:
more verbose output | re-run failing tests | stop on first test that fails
pytest --lf
pytest -v
pytest -x