Skip to content

Commit

Permalink
Tweak error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Naveen authored and Naveen committed Jul 14, 2021
1 parent 8364c03 commit b5ee3bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/_pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion testing/test_skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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*"]
)


Expand Down

0 comments on commit b5ee3bf

Please sign in to comment.