I'm having trouble getting the VS Code PyTest code runner to work the way I'd like. It seems pytest options may be an all-or-nothing situation.
Is there any way to run different sets of PyTest options easily in the VS Code interface?
For example:
By default, run all tests not marked with
@pytest.mark.slow
.- This can be done with the argument
-m "not slow"
- But, if I put that in a pytest.ini file, then it will never run any tests marked slow, even if I pick that particular test in the interface and try to run it. The resulting output is
collected 1 item... 1 item deselected
.
- This can be done with the argument
Run sometimes with coverage enabled, and sometimes without.
The only way I can see to do this is to run PyTest from the command line, which then loses the benefit of auto-discovery, running/debugging individual tests from the in-line interface, etc.
What am I missing?
Note: Currently using VS Code 1.45.1, Python 3.7.6, and PyTest 5.3.5