From 47ab3e8262144cb962fc2769bf7551fc23c3ce2b Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Sun, 20 Sep 2020 06:17:29 -0700 Subject: [PATCH] @slow has to be last (#7251) Found an issue when `@slow` isn't the last decorator (gets ignored!), so documenting this significance. --- docs/source/testing.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/source/testing.rst b/docs/source/testing.rst index ef5fe26933..f125c3a6f8 100644 --- a/docs/source/testing.rst +++ b/docs/source/testing.rst @@ -756,7 +756,14 @@ To run such tests set ``RUN_SLOW=1`` env var, e.g.: .. code-block:: bash RUN_SLOW=1 pytest tests + +It's important that the decorator ``@slow`` appears last in the stack of decorators, as some decorators like ``parametrized`` may interfere with its normal functioning. Here is an example of the correct usage: +.. code-block:: python + + @parameterized.expand(...) + @slow + def test_integration_foo(): Testing the stdout/stderr output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~