summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_index_tricks.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2020-01-05 00:53:30 -0500
committerWarren Weckesser <warren.weckesser@gmail.com>2020-01-05 00:53:30 -0500
commitc31cc36a8a814ed4844a2a553454185601914a5a (patch)
treeadb28a762dc0985eed669db75b564b3f5c3bfbcc /numpy/lib/tests/test_index_tricks.py
parentc1f1bc9ce8e4e2936e80d9bfafc3d8e03237a84b (diff)
downloadnumpy-c31cc36a8a814ed4844a2a553454185601914a5a.tar.gz
MAINT: Remove implicit inheritance from object class (#15236)
Inheriting from object was necessary for Python 2 compatibility to use new-style classes. In Python 3, this is unnecessary as there are no old-style classes. Dropping the object is more idiomatic Python.
Diffstat (limited to 'numpy/lib/tests/test_index_tricks.py')
-rw-r--r--numpy/lib/tests/test_index_tricks.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index bfc37ef9c..905165a99 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -12,7 +12,7 @@ from numpy.lib.index_tricks import (
)
-class TestRavelUnravelIndex(object):
+class TestRavelUnravelIndex:
def test_basic(self):
assert_equal(np.unravel_index(2, (2, 2)), (1, 0))
@@ -192,7 +192,7 @@ class TestRavelUnravelIndex(object):
with assert_raises(ValueError):
np.unravel_index([1], (2, 1, 0))
-class TestGrid(object):
+class TestGrid:
def test_basic(self):
a = mgrid[-1:1:10j]
b = mgrid[-1:1:0.1]
@@ -250,7 +250,7 @@ class TestGrid(object):
assert_equal(grid_small.size, expected[1])
-class TestConcatenator(object):
+class TestConcatenator:
def test_1d(self):
assert_array_equal(r_[1, 2, 3, 4, 5, 6], np.array([1, 2, 3, 4, 5, 6]))
b = np.ones(5)
@@ -288,14 +288,14 @@ class TestConcatenator(object):
assert_equal(r_[np.array(0), [1, 2, 3]], [0, 1, 2, 3])
-class TestNdenumerate(object):
+class TestNdenumerate:
def test_basic(self):
a = np.array([[1, 2], [3, 4]])
assert_equal(list(ndenumerate(a)),
[((0, 0), 1), ((0, 1), 2), ((1, 0), 3), ((1, 1), 4)])
-class TestIndexExpression(object):
+class TestIndexExpression:
def test_regression_1(self):
# ticket #1196
a = np.arange(2)
@@ -309,7 +309,7 @@ class TestIndexExpression(object):
assert_equal(a[:, :3, [1, 2]], a[s_[:, :3, [1, 2]]])
-class TestIx_(object):
+class TestIx_:
def test_regression_1(self):
# Test empty untyped inputs create outputs of indexing type, gh-5804
a, = np.ix_(range(0))
@@ -356,7 +356,7 @@ def test_c_():
assert_equal(a, [[1, 2, 3, 0, 0, 4, 5, 6]])
-class TestFillDiagonal(object):
+class TestFillDiagonal:
def test_basic(self):
a = np.zeros((3, 3), int)
fill_diagonal(a, 5)
@@ -455,7 +455,7 @@ def test_diag_indices():
)
-class TestDiagIndicesFrom(object):
+class TestDiagIndicesFrom:
def test_diag_indices_from(self):
x = np.random.random((4, 4))