Verify that using pytest.skip at module level causes a collection error.
(pytester: Pytester)
| 1327 | |
| 1328 | |
| 1329 | def test_module_level_skip_error(pytester: Pytester) -> None: |
| 1330 | """Verify that using pytest.skip at module level causes a collection error.""" |
| 1331 | pytester.makepyfile( |
| 1332 | """ |
| 1333 | import pytest |
| 1334 | pytest.skip("skip_module_level") |
| 1335 | |
| 1336 | def test_func(): |
| 1337 | assert True |
| 1338 | """ |
| 1339 | ) |
| 1340 | result = pytester.runpytest() |
| 1341 | result.stdout.fnmatch_lines( |
| 1342 | ["*Using pytest.skip outside of a test will skip the entire module*"] |
| 1343 | ) |
| 1344 | |
| 1345 | |
| 1346 | def test_module_level_skip_with_allow_module_level(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected