Skip to content

Commit 2fd4549

Browse files
[7.2.x] docs: be more explicit about module level skip preventing collection (#10777)
Co-authored-by: Ronny Pfannschmidt <[email protected]>
1 parent cee8d6f commit 2fd4549

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

changelog/10753.doc.rst

+2
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

+6-2
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)