Skip to content

Commit fc02003

Browse files
authored
Merge pull request #1975 from nicoddemus/pytest-skip-message
Pytest skip message
2 parents a87b1c7 + 336d790 commit fc02003

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

_pytest/python.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ def _importtestmodule(self):
435435
if e.allow_module_level:
436436
raise
437437
raise self.CollectError(
438-
"Using @pytest.skip outside of a test (e.g. as a test "
439-
"function decorator) is not allowed. Use @pytest.mark.skip or "
440-
"@pytest.mark.skipif instead."
438+
"Using pytest.skip outside of a test is not allowed. If you are "
439+
"trying to decorate a test function, use the @pytest.mark.skip "
440+
"or @pytest.mark.skipif decorators instead."
441441
)
442442
self.config.pluginmanager.consider_module(mod)
443443
return mod

testing/test_skipping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,5 +967,5 @@ def test_func():
967967
""")
968968
result = testdir.runpytest()
969969
result.stdout.fnmatch_lines(
970-
"*Using @pytest.skip outside of a test * is not allowed*"
970+
"*Using pytest.skip outside of a test is not allowed*"
971971
)

0 commit comments

Comments
 (0)