Skip to content

Commit 72ad324

Browse files
Docs: be more explicit about module level skip preventing collection (#10753)
1 parent 572b565 commit 72ad324

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

changelog/10753.doc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Change wording of the module level skip to be very explicit
2+
about not collecting and not executing the rest of the module.

src/_pytest/outcomes.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@ def skip(
157157
The message to show the user as reason for the skip.
158158
159159
:param allow_module_level:
160-
Allows this function to be called at module level, skipping the rest
161-
of the module. Defaults to False.
160+
Allows this function to be called at module level.
161+
Raising the skip exception at module level will stop
162+
the execution of the module and prevent the collection of all tests in the module,
163+
even those defined before the `skip` call.
164+
165+
Defaults to False.
162166
163167
:param msg:
164168
Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.

0 commit comments

Comments
 (0)