Skip to content

Commit 3d955ad

Browse files
committed
Fix problems with new tests
1 parent a272fc8 commit 3d955ad

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pandas/tests/test_categorical.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4601,25 +4601,25 @@ def f():
46014601
df = pd.DataFrame({'a': pd.Categorical(idx)})
46024602
tm.assert_frame_equal(df.fillna(value=pd.NaT), df)
46034603

4604-
@pytest.mark.parametrize('fill_value expected_output', [
4604+
@pytest.mark.parametrize('fill_value, expected_output', [
46054605
('a', ['a', 'a', 'b', 'a', 'a']),
46064606
({1: 'a', 3: 'b', 4: 'b'}, ['a', 'a', 'b', 'b', 'b']),
46074607
({1: 'a'}, ['a', 'a', 'b', np.nan, np.nan]),
46084608
({1: 'a', 3: 'b'}, ['a', 'a', 'b', 'b', np.nan]),
46094609
(pd.Series('a'), ['a', np.nan, 'b', np.nan, np.nan]),
46104610
(pd.Series('a', index=[1]), ['a', 'a', 'b', np.nan, np.nan]),
46114611
(pd.Series({1: 'a', 3: 'b'}), ['a', 'a', 'b', 'b', np.nan]),
4612-
(pd.Series(['a', 'b'], index=[3, 4]))
4612+
(pd.Series(['a', 'b'], index=[3, 4]), ['a', np.nan, 'b', 'a', 'b'])
46134613
])
4614-
def fillna_series_categorical(self, fill_value, expected_output):
4614+
def test_fillna_series_categorical(self, fill_value, expected_output):
46154615
# GH 17033
46164616
# Test fillna for a Categorical series
46174617
data = ['a', np.nan, 'b', np.nan, np.nan]
46184618
s = pd.Series(pd.Categorical(data, categories=['a', 'b']))
46194619
exp = pd.Series(pd.Categorical(expected_output, categories=['a', 'b']))
46204620
tm.assert_series_equal(s.fillna(fill_value), exp)
46214621

4622-
def fillna_series_categorical_errormsg(self):
4622+
def test_fillna_series_categorical_errormsg(self):
46234623
data = ['a', np.nan, 'b', np.nan, np.nan]
46244624
s = pd.Series(pd.Categorical(data, categories=['a', 'b']))
46254625

@@ -4637,7 +4637,7 @@ def fillna_series_categorical_errormsg(self):
46374637

46384638
with tm.assert_raises_regex(TypeError,
46394639
'"value" parameter must be a scalar or '
4640-
'dict but you passed a "list"'):
4640+
'dict, but you passed a "list"'):
46414641
s.fillna(['a', 'b'])
46424642

46434643
def test_astype_to_other(self):
@@ -4973,3 +4973,4 @@ def test_map(self):
49734973
assert isinstance(res, tm.SubclassedCategorical)
49744974
exp = Categorical(['A', 'B', 'C'])
49754975
tm.assert_categorical_equal(res, exp)
4976+

0 commit comments

Comments
 (0)