From b5ee3bfe3041004ae87f4937e89e6fc358ebbbb8 Mon Sep 17 00:00:00 2001 From: Naveen Date: Wed, 14 Jul 2021 13:08:31 +0000 Subject: [PATCH] Tweak error message --- src/_pytest/python.py | 6 +++--- testing/test_skipping.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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*"] )