summaryrefslogtreecommitdiff
path: root/numpy/matrixlib/tests/test_defmatrix.py
diff options
context:
space:
mode:
authorRoman Yurchak <rth.yurchak@pm.me>2018-09-13 04:49:37 +0200
committerEric Wieser <wieser.eric@gmail.com>2018-09-12 19:49:37 -0700
commit88cbd3d857db84cf820a6210fde14814f1d1d92b (patch)
tree1e759353a844b9bd0d0c26bbd2834ff0cd61fbb8 /numpy/matrixlib/tests/test_defmatrix.py
parentfe6beb288befa5506b5c41ed498054e24b5241b5 (diff)
downloadnumpy-88cbd3d857db84cf820a6210fde14814f1d1d92b.tar.gz
TST: Replace calls to unittest.TestCase.fail (#11933)
After the pytest migration, test classes no longer inherit from unittest.TestCase and and the fail method does not exist anymore. In all these cases, we can use assert_raises and assert_raises_regex instead
Diffstat (limited to 'numpy/matrixlib/tests/test_defmatrix.py')
-rw-r--r--numpy/matrixlib/tests/test_defmatrix.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/numpy/matrixlib/tests/test_defmatrix.py b/numpy/matrixlib/tests/test_defmatrix.py
index 4cff5ee9b..f8a8ad511 100644
--- a/numpy/matrixlib/tests/test_defmatrix.py
+++ b/numpy/matrixlib/tests/test_defmatrix.py
@@ -268,21 +268,13 @@ class TestAlgebra(object):
[3., 4.]])
# __rpow__
- try:
+ with assert_raises(TypeError):
1.0**A
- except TypeError:
- pass
- else:
- self.fail("matrix.__rpow__ doesn't raise a TypeError")
# __mul__ with something not a list, ndarray, tuple, or scalar
- try:
+ with assert_raises(TypeError):
A*object()
- except TypeError:
- pass
- else:
- self.fail("matrix.__mul__ with non-numeric object doesn't raise"
- "a TypeError")
+
class TestMatrixReturn(object):
def test_instance_methods(self):