Skip to content

Commit 0fb31f8

Browse files
committed
Update skipping documentation to include usage of allow_module_level kwarg
1 parent 5a3f131 commit 0fb31f8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/en/skipping.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ by calling the ``pytest.skip(reason)`` function:
5454
if not valid_config():
5555
pytest.skip("unsupported configuration")
5656
57+
It is also possible to skip the whole module using
58+
``pytest.skip(reason, allow_module_level=True)`` at the module level:
59+
60+
61+
.. code-block:: python
62+
63+
if not enabled_platform_edge_cases():
64+
pytest.skip("unsupported platform", allow_module_level=True)
65+
5766
The imperative method is useful when it is not possible to evaluate the skip condition
5867
during import time.
5968

0 commit comments

Comments
 (0)