[pytest-dev] excluding marked tests as default behavior

Ofer Nave onave at dyn.com
Tue Apr 16 21:39:54 CEST 2013


I understand I can mark tests with `@pytest.mark.whatever` and run them 
specifically with `pytest -m whatever`, or run skip them with `pytest -m 
'not whatever'`.  But how I can configure pytest in my package such that 
the default behavior is to skip those tests?

Specifically, I have some tests that are very slow (multiple seconds 
each).  I want to mark them 'slow', and have the default behavior when 
running `pytest` be to skip them.  That way they will only run if you 
explicitly run them with `pytest -m slow`.

Is there a way to configure this in conftest.py?

-ofer


More information about the Pytest-dev mailing list