From a10da0e5401dc51cda10ede3095d2958c7720196 Mon Sep 17 00:00:00 2001 From: Raphael Pierzina Date: Wed, 30 Sep 2015 19:41:47 +0200 Subject: [PATCH] Implement skipif marker for slow test based on pytest.config --- doc/en/example/simple.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 03471b917..963b561ac 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -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