Skip to content

Commit 14cffa3

Browse files
committed
Recommend using pytestmark in testing docs
The testing documentation already recommends placing all remote tests in a separate test module. This allows applying the `remote-data` mark to all the test functions through the `pytestmark` global variable instead of applying a decorator to each function separately.
1 parent 0883e92 commit 14cffa3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/testing.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ the ``test_module.py`` file.
8484
``test_module_remote.py``
8585
-------------------------
8686

87-
The remote tests are much easier. Just decorate the test class or test
88-
functions with ``@pytest.mark.remote_data``.
87+
The remote tests are much easier. The file must contain the following::
88+
89+
import pytest
90+
91+
pytestmark = pytest.mark.remote_data
92+
93+
This ensures that the test functions in remote test module are only executed if
94+
the ``--remote-data`` flag is used.
8995

9096
``setup_package.py``
9197
--------------------

0 commit comments

Comments
 (0)