summaryrefslogtreecommitdiff
path: root/tests/test_setup_command.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-06-01 14:39:43 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-06-07 01:22:55 +0900
commitfb41dcefab5e00ab8022f543bfc84f111b7a38b5 (patch)
tree2fb85e58be770621cb4236ae33cac6c18948c373 /tests/test_setup_command.py
parent88cbd6a5975ce089de9f85b9bec3820aad9b37f7 (diff)
downloadsphinx-git-fb41dcefab5e00ab8022f543bfc84f111b7a38b5.tar.gz
Fix sphinx.testing uses deprecated pytest API; Node.get_marker(name)
Diffstat (limited to 'tests/test_setup_command.py')
-rw-r--r--tests/test_setup_command.py5
1 files changed, 4 insertions, 1 deletions
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'