From 5f83069d86f394a36179013132f99024f8f6e85d Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sun, 19 Feb 2023 22:54:37 +0100 Subject: [PATCH] docs: be more explicit about module level skip preventing collection --- changelog/10753.doc.rst | 2 ++ src/_pytest/outcomes.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelog/10753.doc.rst diff --git a/changelog/10753.doc.rst b/changelog/10753.doc.rst new file mode 100644 index 000000000..701d81a7c --- /dev/null +++ b/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. diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 2a998e421..66b44ea7c 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -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 in a module will stop the execution of the module. + Additionally, the module will no longer be collected. + + Defaults to False. :param msg: Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead.