Use a variable for the skipif marker as suggested by @nicoddemus

This commit is contained in:
Raphael Pierzina 2015-09-30 21:53:34 +02:00
parent a10da0e540
commit 4829eac1e1
1 changed files with 8 additions and 3 deletions

View File

@ -137,13 +137,18 @@ We can now write a test module like this::
import pytest
def test_func_fast():
pass
@pytest.mark.skipif(
slow = pytest.mark.skipif(
not pytest.config.getoption("--runslow"),
reason="need --runslow option to run"
)
def test_func_fast():
pass
@slow
def test_func_slow():
pass