summaryrefslogtreecommitdiff
path: root/numpy/testing
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/testing
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/testing')
-rw-r--r--numpy/testing/tests/test_utils.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index 2c60e2867..54f8a281a 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -25,12 +25,8 @@ class _GenericTest(object):
self._assert_func(a, b)
def _test_not_equal(self, a, b):
- try:
+ with assert_raises(AssertionError):
self._assert_func(a, b)
- except AssertionError:
- pass
- else:
- raise AssertionError("a and b are found equal but are not")
def test_array_rank1_eq(self):
"""Test two equal array of rank 1 are found equal."""