Pytest: skipping tests
examples/pytest/test_on_condition.py
import sys import pytest @pytest.mark.skipif(sys.platform != 'darwin', reason="Mac tests") def test_mac(): assert True @pytest.mark.skipif(sys.platform != 'linux', reason="Linux tests") def test_linux(): assert True @pytest.mark.skipif(sys.platform != 'win32', reason="Windows tests") def test_windows(): assert True @pytest.mark.skip(reason="To show we can skip tests without any condition.") def test_any(): assert True
pytest test_on_condition.py
collected 4 items test_on_condition.py ss.s ==== 1 passed, 3 skipped in 0.02 seconds ====