diff --git a/src/_pytest/python.py b/src/_pytest/python.py index cdd6b51c270..420a969796a 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -608,9 +608,9 @@ def _importtestmodule(self): if e.allow_module_level: raise raise self.CollectError( - "Using pytest.skip outside will skip the entire module, " - "if that's your intention pass `allow_module_level=True`. " - "If you want to skip a specific test or entire class, " + "Using pytest.skip outside of a test will skip the entire module. " + "If that's your intention, pass `allow_module_level=True`. " + "If you want to skip a specific test or an entire class, " "use the @pytest.mark.skip or @pytest.mark.skipif decorators." ) from e self.config.pluginmanager.consider_module(mod) diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 9908e5b07ac..d50a16c9078 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -1341,7 +1341,7 @@ def test_func(): ) result = pytester.runpytest() result.stdout.fnmatch_lines( - ["*Using pytest.skip outside will skip the entire module*"] + ["*Using pytest.skip outside of a test will skip the entire module*"] )