summaryrefslogtreecommitdiff
path: root/numpy/ma
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/ma
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/ma')
-rw-r--r--numpy/ma/tests/test_core.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index a08a0d956..21e0fc41a 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -3806,12 +3806,8 @@ class TestMaskedArrayFunctions(object):
def test_masked_where_shape_constraint(self):
a = arange(10)
- try:
- test = masked_equal(1, a)
- except IndexError:
- pass
- else:
- raise AssertionError("Should have failed...")
+ with assert_raises(IndexError):
+ masked_equal(1, a)
test = masked_equal(a, 1)
assert_equal(test.mask, [0, 1, 0, 0, 0, 0, 0, 0, 0, 0])