With pytest, one can mark tests using a decorator
@pytest.mark.slow
def some_slow_test():
pass
Then, from the command line, one can tell py
Is your test correctly written? Normally, tests start with test_
?
But anyway, it depended on what you try to filter, you can filter those tests by name using -k "not slow and not long"
or by tag using -m "not slow and not long"
.
-k
:
This will run tests which contain names that match the given string expression (case-insensitive), which can include Python operators that use filenames, class names and function names as variables.
-m
:
Will run all tests which are decorated with the @pytest.mark.slow
decorator.
pytest --help