Skip to content

Commit

Permalink
Improve error message when using pytest.skip at module level
Browse files Browse the repository at this point in the history
As discussed in issue #1959.
  • Loading branch information
Nikratio authored and nicoddemus committed Oct 1, 2016
1 parent a87b1c7 commit 57bb3c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,9 @@ def _importtestmodule(self):
if e.allow_module_level:
raise
raise self.CollectError(
"Using @pytest.skip outside of a test (e.g. as a test "
"function decorator) is not allowed. Use @pytest.mark.skip or "
"@pytest.mark.skipif instead."
"Using pytest.skip outside of a test is not allowed. If you are "
"trying to decorate a test function, use the @pytest.mark.skip "
"or @pytest.mark.skipif decorators instead."
)
self.config.pluginmanager.consider_module(mod)
return mod
Expand Down

0 comments on commit 57bb3c6

Please sign in to comment.