From e4a6e52b81c96bbeab2ff5506994722408622fd1 Mon Sep 17 00:00:00 2001 From: "George Y. Kussumoto" Date: Sun, 1 Oct 2017 18:40:19 -0300 Subject: [PATCH] Update skipping documentation to include usage of allow_module_level kwarg --- doc/en/skipping.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/en/skipping.rst b/doc/en/skipping.rst index 630f73422..e6f1bc3c5 100644 --- a/doc/en/skipping.rst +++ b/doc/en/skipping.rst @@ -54,6 +54,15 @@ by calling the ``pytest.skip(reason)`` function: if not valid_config(): pytest.skip("unsupported configuration") +It is also possible to skip the whole module using +``pytest.skip(reason, allow_module_level=True)`` at the module level: + + +.. code-block:: python + + if not enabled_platform_edge_cases(): + pytest.skip("unsupported platform", allow_module_level=True) + The imperative method is useful when it is not possible to evaluate the skip condition during import time.