summaryrefslogtreecommitdiff
path: root/numpy/testing/_private/nosetester.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/testing/_private/nosetester.py')
-rw-r--r--numpy/testing/_private/nosetester.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/numpy/testing/_private/nosetester.py b/numpy/testing/_private/nosetester.py
index 19569a509..bd6d002aa 100644
--- a/numpy/testing/_private/nosetester.py
+++ b/numpy/testing/_private/nosetester.py
@@ -4,12 +4,9 @@ Nose test running.
This module implements ``test()`` and ``bench()`` functions for NumPy modules.
"""
-from __future__ import division, absolute_import, print_function
-
import os
import sys
import warnings
-from numpy.compat import basestring
import numpy as np
from .utils import import_nose, suppress_warnings
@@ -112,7 +109,7 @@ def run_module_suite(file_to_run=None, argv=None):
nose.run(argv=argv, addplugins=[KnownFailurePlugin()])
-class NoseTester(object):
+class NoseTester:
"""
Nose test runner.
@@ -214,7 +211,7 @@ class NoseTester(object):
'''
argv = [__file__, self.package_path, '-s']
if label and label != 'full':
- if not isinstance(label, basestring):
+ if not isinstance(label, str):
raise TypeError('Selection label should be a string')
if label == 'fast':
label = 'not slow'
@@ -421,7 +418,7 @@ class NoseTester(object):
_warn_opts = dict(develop=(Warning,),
release=())
- if isinstance(raise_warnings, basestring):
+ if isinstance(raise_warnings, str):
raise_warnings = _warn_opts[raise_warnings]
with suppress_warnings("location") as sup:
@@ -450,20 +447,6 @@ class NoseTester(object):
warnings.simplefilter("always")
from ...distutils import cpuinfo
sup.filter(category=UserWarning, module=cpuinfo)
- # See #7949: Filter out deprecation warnings due to the -3 flag to
- # python 2
- if sys.version_info.major == 2 and sys.py3kwarning:
- # This is very specific, so using the fragile module filter
- # is fine
- import threading
- sup.filter(DeprecationWarning,
- r"sys\.exc_clear\(\) not supported in 3\.x",
- module=threading)
- sup.filter(DeprecationWarning, message=r"in 3\.x, __setslice__")
- sup.filter(DeprecationWarning, message=r"in 3\.x, __getslice__")
- sup.filter(DeprecationWarning, message=r"buffer\(\) not supported in 3\.x")
- sup.filter(DeprecationWarning, message=r"CObject type is not supported in 3\.x")
- sup.filter(DeprecationWarning, message=r"comparing unequal types not supported in 3\.x")
# Filter out some deprecation warnings inside nose 1.3.7 when run
# on python 3.5b2. See
# https://github.com/nose-devs/nose/issues/929