diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/_pytesttester.py | 17 | ||||
-rw-r--r-- | numpy/core/tests/test_numeric.py | 2 | ||||
-rw-r--r-- | numpy/lib/_datasource.py | 20 |
3 files changed, 6 insertions, 33 deletions
diff --git a/numpy/_pytesttester.py b/numpy/_pytesttester.py index 8b6e3217e..e573d53ab 100644 --- a/numpy/_pytesttester.py +++ b/numpy/_pytesttester.py @@ -125,13 +125,6 @@ class PytestTester: import pytest import warnings - #FIXME This is no longer needed? Assume it was for use in tests. - # cap verbosity at 3, which is equivalent to the pytest '-vv' option - #from . import utils - #verbose = min(int(verbose), 3) - #utils.verbose = verbose - # - module = sys.modules[self.module_name] module_path = os.path.abspath(module.__path__[0]) @@ -162,16 +155,6 @@ class PytestTester: "-W ignore:the matrix subclass is not", ] - # Ignore python2.7 -3 warnings - pytest_args += [ - r"-W ignore:buffer\(\) not supported in 3\.x:DeprecationWarning", - r"-W ignore:CObject type is not supported in 3\.x:DeprecationWarning", - r"-W ignore:comparing unequal types not supported in 3\.x:DeprecationWarning", - r"-W ignore:the commands module has been removed in Python 3\.0:DeprecationWarning", - r"-W ignore:The 'new' module has been removed in Python 3\.0:DeprecationWarning", - ] - - if doctests: raise ValueError("Doctests not supported") diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py index c4956c298..33e71a064 100644 --- a/numpy/core/tests/test_numeric.py +++ b/numpy/core/tests/test_numeric.py @@ -2015,7 +2015,7 @@ class TestClip: def test_NaT_propagation(self, arr, amin, amax): # NOTE: the expected function spec doesn't # propagate NaT, but clip() now does - expected = np.minimum(np.maximum(a, amin), amax) + expected = np.minimum(np.maximum(arr, amin), amax) actual = np.clip(arr, amin, amax) assert_equal(actual, expected) diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py index cb337ce83..76cc306b7 100644 --- a/numpy/lib/_datasource.py +++ b/numpy/lib/_datasource.py @@ -304,10 +304,7 @@ class DataSource: """Test if path is a net location. Tests the scheme and netloc.""" # We do this here to reduce the 'import numpy' initial import time. - if sys.version_info[0] >= 3: - from urllib.parse import urlparse - else: - from urlparse import urlparse + from urllib.parse import urlparse # BUG : URLs require a scheme string ('http://') to be used. # www.google.com will fail. @@ -324,14 +321,10 @@ class DataSource: Creates a copy of the file in the datasource cache. """ - # We import these here because importing urllib2 is slow and + # We import these here because importing urllib is slow and # a significant fraction of numpy's total import time. - if sys.version_info[0] >= 3: - from urllib.request import urlopen - from urllib.error import URLError - else: - from urllib2 import urlopen - from urllib2 import URLError + from urllib.request import urlopen + from urllib.error import URLError upath = self.abspath(path) @@ -406,10 +399,7 @@ class DataSource: """ # We do this here to reduce the 'import numpy' initial import time. - if sys.version_info[0] >= 3: - from urllib.parse import urlparse - else: - from urlparse import urlparse + from urllib.parse import urlparse # TODO: This should be more robust. Handles case where path includes # the destpath, but not other sub-paths. Failing case: |