Module 3: Markers and Test Selection

# test_markers.py

import pytest

@pytest.mark.slow
def test_something_slow():
    # test implementation

@pytest.mark.fast
def test_something_fast():
    # test implementation

@pytest.mark.skip(reason="Test not implemented yet")
def test_something_skipped():
    pass
# run_tests.py

import pytest

pytest.main(["-m", "slow", "test_markers.py"])

Last updated