summaryrefslogtreecommitdiff
path: root/numpy/matrixlib/tests
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/matrixlib/tests')
-rw-r--r--numpy/matrixlib/tests/test_defmatrix.py18
-rw-r--r--numpy/matrixlib/tests/test_interaction.py2
-rw-r--r--numpy/matrixlib/tests/test_masked_matrix.py6
-rw-r--r--numpy/matrixlib/tests/test_multiarray.py2
-rw-r--r--numpy/matrixlib/tests/test_numeric.py2
-rw-r--r--numpy/matrixlib/tests/test_regression.py2
6 files changed, 16 insertions, 16 deletions
diff --git a/numpy/matrixlib/tests/test_defmatrix.py b/numpy/matrixlib/tests/test_defmatrix.py
index 68151833b..a8070898f 100644
--- a/numpy/matrixlib/tests/test_defmatrix.py
+++ b/numpy/matrixlib/tests/test_defmatrix.py
@@ -14,7 +14,7 @@ from numpy.testing import (
from numpy.linalg import matrix_power
from numpy.matrixlib import mat
-class TestCtor(object):
+class TestCtor:
def test_basic(self):
A = np.array([[1, 2], [3, 4]])
mA = matrix(A)
@@ -61,7 +61,7 @@ class TestCtor(object):
assert_(np.all(b2 == mixresult))
-class TestProperties(object):
+class TestProperties:
def test_sum(self):
"""Test whether matrix.sum(axis=1) preserves orientation.
Fails in NumPy <= 0.9.6.2127.
@@ -194,7 +194,7 @@ class TestProperties(object):
B = matrix([[True], [True], [False]])
assert_array_equal(A, B)
-class TestCasting(object):
+class TestCasting:
def test_basic(self):
A = np.arange(100).reshape(10, 10)
mA = matrix(A)
@@ -213,7 +213,7 @@ class TestCasting(object):
assert_(np.all(mA != mB))
-class TestAlgebra(object):
+class TestAlgebra:
def test_basic(self):
import numpy.linalg as linalg
@@ -272,7 +272,7 @@ class TestAlgebra(object):
A*object()
-class TestMatrixReturn(object):
+class TestMatrixReturn:
def test_instance_methods(self):
a = matrix([1.0], dtype='f8')
methodargs = {
@@ -314,7 +314,7 @@ class TestMatrixReturn(object):
assert_(type(d) is np.ndarray)
-class TestIndexing(object):
+class TestIndexing:
def test_basic(self):
x = asmatrix(np.zeros((3, 2), float))
y = np.zeros((3, 1), float)
@@ -323,7 +323,7 @@ class TestIndexing(object):
assert_equal(x, [[0, 1], [0, 0], [0, 0]])
-class TestNewScalarIndexing(object):
+class TestNewScalarIndexing:
a = matrix([[1, 2], [3, 4]])
def test_dimesions(self):
@@ -390,7 +390,7 @@ class TestNewScalarIndexing(object):
assert_array_equal(x[[2, 1, 0],:], x[::-1,:])
-class TestPower(object):
+class TestPower:
def test_returntype(self):
a = np.array([[0, 1], [0, 0]])
assert_(type(matrix_power(a, 2)) is np.ndarray)
@@ -401,7 +401,7 @@ class TestPower(object):
assert_array_equal(matrix_power([[0, 1], [0, 0]], 2), [[0, 0], [0, 0]])
-class TestShape(object):
+class TestShape:
a = np.array([[1], [2]])
m = matrix([[1], [2]])
diff --git a/numpy/matrixlib/tests/test_interaction.py b/numpy/matrixlib/tests/test_interaction.py
index c0b1a9fc1..608416ed7 100644
--- a/numpy/matrixlib/tests/test_interaction.py
+++ b/numpy/matrixlib/tests/test_interaction.py
@@ -288,7 +288,7 @@ def test_kron_matrix():
assert_equal(type(np.kron(m, a)), np.matrix)
-class TestConcatenatorMatrix(object):
+class TestConcatenatorMatrix:
# 2018-04-29: moved here from core.tests.test_index_tricks.
def test_matrix(self):
a = [1, 2]
diff --git a/numpy/matrixlib/tests/test_masked_matrix.py b/numpy/matrixlib/tests/test_masked_matrix.py
index ab70be6ff..45424ecf0 100644
--- a/numpy/matrixlib/tests/test_masked_matrix.py
+++ b/numpy/matrixlib/tests/test_masked_matrix.py
@@ -27,7 +27,7 @@ class MMatrix(MaskedArray, np.matrix,):
return _view
-class TestMaskedMatrix(object):
+class TestMaskedMatrix:
def test_matrix_indexing(self):
# Tests conversions and indexing
x1 = np.matrix([[1, 2, 3], [4, 3, 2]])
@@ -169,7 +169,7 @@ class TestMaskedMatrix(object):
assert_(not isinstance(test, MaskedArray))
-class TestSubclassing(object):
+class TestSubclassing:
# Test suite for masked subclasses of ndarray.
def setup(self):
@@ -210,7 +210,7 @@ class TestSubclassing(object):
assert_(isinstance(divide(mx, x), MMatrix))
assert_equal(divide(mx, mx), divide(xmx, xmx))
-class TestConcatenator(object):
+class TestConcatenator:
# Tests for mr_, the equivalent of r_ for masked arrays.
def test_matrix_builder(self):
diff --git a/numpy/matrixlib/tests/test_multiarray.py b/numpy/matrixlib/tests/test_multiarray.py
index d34c6de0d..638d0d153 100644
--- a/numpy/matrixlib/tests/test_multiarray.py
+++ b/numpy/matrixlib/tests/test_multiarray.py
@@ -1,7 +1,7 @@
import numpy as np
from numpy.testing import assert_, assert_equal, assert_array_equal
-class TestView(object):
+class TestView:
def test_type(self):
x = np.array([1, 2, 3])
assert_(isinstance(x.view(np.matrix), np.matrix))
diff --git a/numpy/matrixlib/tests/test_numeric.py b/numpy/matrixlib/tests/test_numeric.py
index 7e4b4d304..a772bb388 100644
--- a/numpy/matrixlib/tests/test_numeric.py
+++ b/numpy/matrixlib/tests/test_numeric.py
@@ -1,7 +1,7 @@
import numpy as np
from numpy.testing import assert_equal
-class TestDot(object):
+class TestDot:
def test_matscalar(self):
b1 = np.matrix(np.ones((3, 3), dtype=complex))
assert_equal(b1*1.0, b1)
diff --git a/numpy/matrixlib/tests/test_regression.py b/numpy/matrixlib/tests/test_regression.py
index 187286dd7..a54d44020 100644
--- a/numpy/matrixlib/tests/test_regression.py
+++ b/numpy/matrixlib/tests/test_regression.py
@@ -2,7 +2,7 @@ import numpy as np
from numpy.testing import assert_, assert_equal, assert_raises
-class TestRegression(object):
+class TestRegression:
def test_kron_matrix(self):
# Ticket #71
x = np.matrix('[1 0; 1 0]')