MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_module_level_skip_error

Function test_module_level_skip_error

testing/test_skipping.py:1329–1343  ·  view source on GitHub ↗

Verify that using pytest.skip at module level causes a collection error.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1327
1328
1329def 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
1346def test_module_level_skip_with_allow_module_level(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected