File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -442,9 +442,10 @@ def _importtestmodule(self):
442
442
if e .allow_module_level :
443
443
raise
444
444
raise self .CollectError (
445
- "Using pytest.skip outside of a test is not allowed. If you are "
446
- "trying to decorate a test function, use the @pytest.mark.skip "
447
- "or @pytest.mark.skipif decorators instead."
445
+ "Using pytest.skip outside of a test is not allowed. "
446
+ "To decorate a test function, use the @pytest.mark.skip "
447
+ "or @pytest.mark.skipif decorators instead, and to skip a "
448
+ "module use `pytestmark = pytest.mark.{skip,skipif}."
448
449
)
449
450
self .config .pluginmanager .consider_module (mod )
450
451
return mod
Original file line number Diff line number Diff line change
1
+ Improve error message for CollectError with skip/skipif.
You can’t perform that action at this time.
0 commit comments