Setup hook to skip tests based on markers and options.
(item)
| 142 | ) |
| 143 | |
| 144 | def pytest_runtest_setup(item): |
| 145 | """Setup hook to skip tests based on markers and options.""" |
| 146 | if "slow" in item.keywords and not item.config.getoption("--run-slow"): |
| 147 | pytest.skip("Skipping slow test (use --run-slow to run)") |
| 148 | |
| 149 | if "network" in item.keywords and not item.config.getoption("--run-network"): |
| 150 | pytest.skip("Skipping network test (use --run-network to run)") |
| 151 | |
| 152 | # Test environment setup |
| 153 | @pytest.fixture(autouse=True) |
nothing calls this directly
no outgoing calls
no test coverage detected