summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_ext_apidoc.py5
-rw-r--r--tests/test_setup_command.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_ext_apidoc.py b/tests/test_ext_apidoc.py
index d3d61d1e0..8c81a6e12 100644
--- a/tests/test_ext_apidoc.py
+++ b/tests/test_ext_apidoc.py
@@ -32,7 +32,10 @@ def apidoc(rootdir, tempdir, apidoc_params):
@pytest.fixture
def apidoc_params(request):
- markers = request.node.get_marker("apidoc")
+ if hasattr(request.node, 'iter_markers'): # pytest-3.6.0 or newer
+ markers = request.node.iter_markers("apidoc")
+ else:
+ markers = request.node.get_marker("apidoc")
pargs = {}
kwargs = {}
diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py
index facb8879d..cd1f89c0c 100644
--- a/tests/test_setup_command.py
+++ b/tests/test_setup_command.py
@@ -27,7 +27,10 @@ def setup_command(request, tempdir, rootdir):
Run `setup.py build_sphinx` with args and kwargs,
pass it to the test and clean up properly.
"""
- marker = request.node.get_marker('setup_command')
+ if hasattr(request.node, 'get_closest_marker'): # pytest-3.6.0 or newer
+ marker = request.node.get_closest_marker('setup_command')
+ else:
+ marker = request.node.get_marker('setup_command')
args = marker.args if marker else []
pkgrootdir = tempdir / 'test-setup'