Skip to content

Commit 533e7de

Browse files
jorisvandenbosschejreback
authored andcommitted
TST: fix tests catching unorderable errors for python 3.6 (#15007)
See also MacPython/pandas-wheels#8, seems that the order of int and str is switched in some cases. Therefore making the test here more robust.
1 parent 623f91b commit 533e7de

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/tests/indexes/test_base.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -1807,8 +1807,7 @@ def test_order(self):
18071807
idx = self.create_index()
18081808
# 9816 deprecated
18091809
if PY36:
1810-
with tm.assertRaisesRegexp(TypeError, "'>' not supported "
1811-
"between instances of 'str' and 'int'"):
1810+
with tm.assertRaisesRegexp(TypeError, "'>' not supported"):
18121811
with tm.assert_produces_warning(FutureWarning):
18131812
idx.order()
18141813
elif PY3:
@@ -1822,8 +1821,7 @@ def test_order(self):
18221821
def test_argsort(self):
18231822
idx = self.create_index()
18241823
if PY36:
1825-
with tm.assertRaisesRegexp(TypeError, "'>' not supported "
1826-
"between instances of 'str' and 'int'"):
1824+
with tm.assertRaisesRegexp(TypeError, "'>' not supported"):
18271825
result = idx.argsort()
18281826
elif PY3:
18291827
with tm.assertRaisesRegexp(TypeError, "unorderable types"):
@@ -1836,8 +1834,7 @@ def test_argsort(self):
18361834
def test_numpy_argsort(self):
18371835
idx = self.create_index()
18381836
if PY36:
1839-
with tm.assertRaisesRegexp(TypeError, "'>' not supported "
1840-
"between instances of 'str' and 'int'"):
1837+
with tm.assertRaisesRegexp(TypeError, "'>' not supported"):
18411838
result = np.argsort(idx)
18421839
elif PY3:
18431840
with tm.assertRaisesRegexp(TypeError, "unorderable types"):

0 commit comments

Comments
 (0)