Implement skipif marker for slow test based on pytest.config

This commit is contained in:
Raphael Pierzina 2015-09-30 19:41:47 +02:00
parent 7ac8a88a05
commit a10da0e540
1 changed files with 4 additions and 2 deletions

View File

@ -136,12 +136,14 @@ We can now write a test module like this::
# content of test_module.py
import pytest
slow = pytest.mark.slow
def test_func_fast():
pass
@slow
@pytest.mark.skipif(
not pytest.config.getoption("--runslow"),
reason="need --runslow option to run"
)
def test_func_slow():
pass