Skip to content

Commit 14699c3

Browse files
eric-wieser3553x
authored andcommitted
TST: Don't assert that a bug exists in numpy (pandas-dev#16940)
Better to ignore the warning from the bug, rather than assert the bug is still there After this change, numpy/numpy#9412 _could_ be backported to fix the bug
1 parent 684d141 commit 14699c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/tests/test_algos.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import numpy as np
44
import pytest
5+
import warnings
56

67
from numpy.random import RandomState
78
from numpy import nan
@@ -127,7 +128,7 @@ def test_unsortable(self):
127128
arr = np.array([1, 2, datetime.now(), 0, 3], dtype=object)
128129
if compat.PY2 and not pd._np_version_under1p10:
129130
# RuntimeWarning: tp_compare didn't return -1 or -2 for exception
130-
with tm.assert_produces_warning(RuntimeWarning):
131+
with warnings.catch_warnings():
131132
pytest.raises(TypeError, algos.safe_sort, arr)
132133
else:
133134
pytest.raises(TypeError, algos.safe_sort, arr)

0 commit comments

Comments
 (0)