diff options
author | Takayuki SHIMIZUKAWA <shimizukawa@gmail.com> | 2017-01-07 00:48:27 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-07 00:48:27 +0900 |
commit | 620616cdbd92147f6ea7bbeb670dc3a0562235ff (patch) | |
tree | d9e459cc62d2c1fe783aa665ab56680eca112ab6 /tests/run.py | |
parent | 54c8c012228559c3bf30011977984a60a9299e9b (diff) | |
parent | 89e1df0bba58fc8d420fd9f293c4e325e06fc431 (diff) | |
download | sphinx-git-620616cdbd92147f6ea7bbeb670dc3a0562235ff.tar.gz |
Merge pull request #3302 from sphinx-doc/pytest-stable
pytest migration
Diffstat (limited to 'tests/run.py')
-rwxr-xr-x | tests/run.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/run.py b/tests/run.py index 273b2ee6b..72a668541 100755 --- a/tests/run.py +++ b/tests/run.py @@ -17,14 +17,14 @@ import warnings import traceback from path import path -import nose +import pytest testroot = os.path.dirname(__file__) or '.' sys.path.insert(0, os.path.abspath(os.path.join(testroot, os.path.pardir))) # check dependencies before testing print('Checking dependencies...') -for modname in ('nose', 'mock', 'six', 'docutils', 'jinja2', 'pygments', +for modname in ('pytest', 'mock', 'six', 'docutils', 'jinja2', 'pygments', 'snowballstemmer', 'babel', 'html5lib'): try: __import__(modname) @@ -50,7 +50,15 @@ print('Running Sphinx test suite (with Python %s)...' % sys.version.split()[0]) sys.stdout.flush() # filter warnings of test dependencies -warnings.filterwarnings('ignore', category=DeprecationWarning, module='nose.util') warnings.filterwarnings('ignore', category=DeprecationWarning, module='site') # virtualenv -nose.main(argv=sys.argv) +# exclude 'root' and '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 ('root', 'roots') +] +args = sys.argv[1:] +for path in ignore_paths: + args.extend(['--ignore', path]) + +sys.exit(pytest.main(args)) |