diff options
author | Roman Yurchak <rth.yurchak@pm.me> | 2018-09-13 04:49:37 +0200 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-09-12 19:49:37 -0700 |
commit | 88cbd3d857db84cf820a6210fde14814f1d1d92b (patch) | |
tree | 1e759353a844b9bd0d0c26bbd2834ff0cd61fbb8 /numpy/lib/tests/test_recfunctions.py | |
parent | fe6beb288befa5506b5c41ed498054e24b5241b5 (diff) | |
download | numpy-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/lib/tests/test_recfunctions.py')
-rw-r--r-- | numpy/lib/tests/test_recfunctions.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py index d4828bc1f..5585a95f9 100644 --- a/numpy/lib/tests/test_recfunctions.py +++ b/numpy/lib/tests/test_recfunctions.py @@ -541,12 +541,8 @@ class TestStackArrays(object): test = stack_arrays((a, b), autoconvert=True) assert_equal(test, control) assert_equal(test.mask, control.mask) - try: - test = stack_arrays((a, b), autoconvert=False) - except TypeError: - pass - else: - raise AssertionError + with assert_raises(TypeError): + stack_arrays((a, b), autoconvert=False) def test_checktitles(self): # Test using titles in the field names |