summaryrefslogtreecommitdiff
path: root/numpy/testing
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-03-20 14:55:41 -0500
committerGitHub <noreply@github.com>2021-03-20 14:55:41 -0500
commit9629cd9221766b087478d3dceca8c260b76e82b7 (patch)
tree7051db3cb0203c4d8d8da286b2a88341b960467c /numpy/testing
parent2ccc7942f072b7fdbe54f148cdcb6a7d79388a89 (diff)
parentc1aa1af62f6e9fcdda92d6d0991b15051a565814 (diff)
downloadnumpy-9629cd9221766b087478d3dceca8c260b76e82b7.tar.gz
Merge pull request #18648 from mwtoews/pep-3135
MAINT: use super() as described by PEP 3135
Diffstat (limited to 'numpy/testing')
-rw-r--r--numpy/testing/_private/utils.py6
-rw-r--r--numpy/testing/tests/test_utils.py8
2 files changed, 7 insertions, 7 deletions
diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py
index b4d42728e..5b87d0a06 100644
--- a/numpy/testing/_private/utils.py
+++ b/numpy/testing/_private/utils.py
@@ -2006,7 +2006,7 @@ class clear_and_catch_warnings(warnings.catch_warnings):
def __init__(self, record=False, modules=()):
self.modules = set(modules).union(self.class_modules)
self._warnreg_copies = {}
- super(clear_and_catch_warnings, self).__init__(record=record)
+ super().__init__(record=record)
def __enter__(self):
for mod in self.modules:
@@ -2014,10 +2014,10 @@ class clear_and_catch_warnings(warnings.catch_warnings):
mod_reg = mod.__warningregistry__
self._warnreg_copies[mod] = mod_reg.copy()
mod_reg.clear()
- return super(clear_and_catch_warnings, self).__enter__()
+ return super().__enter__()
def __exit__(self, *exc_info):
- super(clear_and_catch_warnings, self).__exit__(*exc_info)
+ super().__exit__(*exc_info)
for mod in self.modules:
if hasattr(mod, '__warningregistry__'):
mod.__warningregistry__.clear()
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index 261ed9705..31d2cdc76 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -434,10 +434,10 @@ class TestArrayAlmostEqual(_GenericTest):
# (which, e.g., astropy Quantity cannot usefully do). See gh-8452.
class MyArray(np.ndarray):
def __eq__(self, other):
- return super(MyArray, self).__eq__(other).view(np.ndarray)
+ return super().__eq__(other).view(np.ndarray)
def __lt__(self, other):
- return super(MyArray, self).__lt__(other).view(np.ndarray)
+ return super().__lt__(other).view(np.ndarray)
def all(self, *args, **kwargs):
raise NotImplementedError
@@ -585,10 +585,10 @@ class TestAlmostEqual(_GenericTest):
# (which, e.g., astropy Quantity cannot usefully do). See gh-8452.
class MyArray(np.ndarray):
def __eq__(self, other):
- return super(MyArray, self).__eq__(other).view(np.ndarray)
+ return super().__eq__(other).view(np.ndarray)
def __lt__(self, other):
- return super(MyArray, self).__lt__(other).view(np.ndarray)
+ return super().__lt__(other).view(np.ndarray)
def all(self, *args, **kwargs):
raise NotImplementedError