mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
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>
This commit is contained in:
parent
e243e82723
commit
c8d56236c9
@ -15,9 +15,12 @@ from sphinx.testing.path import path
|
|||||||
|
|
||||||
pytest_plugins = 'sphinx.testing.fixtures'
|
pytest_plugins = 'sphinx.testing.fixtures'
|
||||||
|
|
||||||
|
# Exclude 'roots' dirs for pytest test collector
|
||||||
|
collect_ignore = ['roots']
|
||||||
|
|
||||||
# Disable Python version-specific
|
# Disable Python version-specific
|
||||||
if sys.version_info < (3, 5):
|
if sys.version_info < (3, 5):
|
||||||
collect_ignore = ['py35']
|
collect_ignore += ['py35']
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
|
11
tests/run.py
11
tests/run.py
@ -55,14 +55,5 @@ os.makedirs(tempdir)
|
|||||||
print('Running Sphinx test suite (with Python %s)...' % sys.version.split()[0])
|
print('Running Sphinx test suite (with Python %s)...' % sys.version.split()[0])
|
||||||
sys.stdout.flush()
|
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
|
import pytest # NOQA
|
||||||
sys.exit(pytest.main(args))
|
sys.exit(pytest.main(sys.argv[1:]))
|
||||||
|
Loading…
Reference in New Issue
Block a user