def test_module_level_skip_error(pytester: Pytester) -> None:
    """Verify that using pytest.skip at module level causes a collection error."""
    pytester.makepyfile(
        """
        import pytest
        pytest.skip("skip_module_level")

        def test_func():
            assert True
    """
    )
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(
        ["*Using pytest.skip outside of a test will skip the entire module*"]
    )
Verify that using pytest.skip at module level causes a collection error.
testing/test_skipping.py