We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2dd4335 commit 2d38d6aCopy full SHA for 2d38d6a
pandas/tests/test_categorical.py
@@ -86,8 +86,14 @@ def test_constructor_unsortable(self):
86
factor = Categorical.from_array(arr, ordered=False)
87
self.assertFalse(factor.ordered)
88
89
- # this however will raise as cannot be sorted
90
- self.assertRaises(TypeError, lambda : Categorical.from_array(arr, ordered=True))
+ if compat.PY3:
+ self.assertRaises(TypeError, lambda : Categorical.from_array(arr, ordered=True))
91
+ else:
92
+ # this however will raise as cannot be sorted (on PY3 or older numpies)
93
+ if LooseVersion(np.__version__) < "1.10":
94
95
96
+ Categorical.from_array(arr, ordered=True)
97
98
def test_is_equal_dtype(self):
99
0 commit comments