summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2017-10-26 16:59:46 +0100
committerStephen Finucane <stephen@that.guru>2017-12-18 20:10:18 +0000
commitc8d56236c9286adca9664782debf3b1c768ef92d (patch)
tree0e33befd0a96f74beb91fe63ff20d336b8a98ba0
parente243e827236467b67b057b83131248ef1742aacb (diff)
downloadsphinx-git-c8d56236c9286adca9664782debf3b1c768ef92d.tar.gz
tests: Ignore roots using 'collect_ignore'
This is slightly cleaner than how we're doing this at the moment. Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r--tests/conftest.py5
-rwxr-xr-xtests/run.py11
2 files changed, 5 insertions, 11 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index c9719bf80..9ea99dbd9 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -15,9 +15,12 @@ from sphinx.testing.path import path
pytest_plugins = 'sphinx.testing.fixtures'
+# Exclude 'roots' dirs for pytest test collector
+collect_ignore = ['roots']
+
# Disable Python version-specific
if sys.version_info < (3, 5):
- collect_ignore = ['py35']
+ collect_ignore += ['py35']
@pytest.fixture(scope='session')
diff --git a/tests/run.py b/tests/run.py
index a8439ba02..2116e345c 100755
--- a/tests/run.py
+++ b/tests/run.py
@@ -55,14 +55,5 @@ os.makedirs(tempdir)
print('Running Sphinx test suite (with Python %s)...' % sys.version.split()[0])
sys.stdout.flush()
-# exclude 'roots' dirs for pytest test collector
-ignore_paths = [
- os.path.relpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), sub))
- for sub in ('roots',)
-]
-args = sys.argv[1:]
-for ignore_path in ignore_paths:
- args.extend(['--ignore', ignore_path])
-
import pytest # NOQA
-sys.exit(pytest.main(args))
+sys.exit(pytest.main(sys.argv[1:]))