summaryrefslogtreecommitdiff
path: root/tests/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.py')
-rwxr-xr-xtests/run.py16
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))