diff options
author | shimizukawa <shimizukawa@gmail.com> | 2017-01-03 22:24:00 +0900 |
---|---|---|
committer | shimizukawa <shimizukawa@gmail.com> | 2017-01-04 00:59:30 +0900 |
commit | 5b7d237db380a75c27137fb37f0396f4a3dc3ecd (patch) | |
tree | f309a2fd9356e185d55b4937afb515c394066f35 /tests/run.py | |
parent | 54c8c012228559c3bf30011977984a60a9299e9b (diff) | |
download | sphinx-git-5b7d237db380a75c27137fb37f0396f4a3dc3ecd.tar.gz |
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)) |