Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test assertion
  • Loading branch information
TomAugspurger committed Oct 4, 2017
commit 1e8c9ed630353ffa875229a47138e19b17cd5e19
13 changes: 2 additions & 11 deletions pandas/tests/series/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,8 @@ class TestNLargestNSmallest(object):
# not supported on some archs
# Series([3., 2, 1, 2, 5], dtype='complex256'),
Series([3., 2, 1, 2, 5], dtype='complex128'),
Series(list('abcde'))])
Series(list('abcde')),
Series(list('abcde'), dtype='category')])
def test_error(self, r):
dt = r.dtype
msg = ("Cannot use method 'n(larg|small)est' with "
Expand All @@ -1795,16 +1796,6 @@ def test_error(self, r):
with tm.assert_raises_regex(TypeError, msg):
method(arg)

def test_error_categorical_dtype(self):
# same as test_error, but regex hard to escape properly
msg = ("Cannot use method 'n(larg|small)est' with dtype "
"CategoricalDtype.+")
with tm.assert_raises_regex(TypeError, msg):
Series(list('ab'), dtype='category').nlargest(2)

with tm.assert_raises_regex(TypeError, msg):
Series(list('ab'), dtype='category').nsmallest(2)

@pytest.mark.parametrize(
"s",
[v for k, v in s_main_dtypes().iteritems()])
Expand Down