Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: be more explicit about module level skip preventing collection #10753

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/10753.doc.rst
@@ -0,0 +1,2 @@
Change wording of the module level skip to be very explicit
about not collecting and not executing the rest of the module.
7 changes: 5 additions & 2 deletions src/_pytest/outcomes.py
Expand Up @@ -157,8 +157,11 @@ def skip(
The message to show the user as reason for the skip.

:param allow_module_level:
Allows this function to be called at module level, skipping the rest
of the module. Defaults to False.
Allows this function to be called at module level.
Raising the skip exception at module level will stop
the execution of the module and prevent the collection of all tests in the module, even those defined before the `skip` call.
nicoddemus marked this conversation as resolved.
Show resolved Hide resolved

Defaults to False.

:param msg:
Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.
Expand Down