Skip to content

Commit ca9b0b3

Browse files
committed
Fix problems with new tests
1 parent 62ddb7e commit ca9b0b3

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
@@ -4569,25 +4569,25 @@ def f():
45694569
df = DataFrame({'a': Categorical(idx)})
45704570
tm.assert_frame_equal(df.fillna(value=NaT), df)
45714571

4572-
@pytest.mark.parametrize('fill_value expected_output', [
4572+
@pytest.mark.parametrize('fill_value, expected_output', [
45734573
('a', ['a', 'a', 'b', 'a', 'a']),
45744574
({1: 'a', 3: 'b', 4: 'b'}, ['a', 'a', 'b', 'b', 'b']),
45754575
({1: 'a'}, ['a', 'a', 'b', np.nan, np.nan]),
45764576
({1: 'a', 3: 'b'}, ['a', 'a', 'b', 'b', np.nan]),
45774577
(pd.Series('a'), ['a', np.nan, 'b', np.nan, np.nan]),
45784578
(pd.Series('a', index=[1]), ['a', 'a', 'b', np.nan, np.nan]),
45794579
(pd.Series({1: 'a', 3: 'b'}), ['a', 'a', 'b', 'b', np.nan]),
4580-
(pd.Series(['a', 'b'], index=[3, 4]))
4580+
(pd.Series(['a', 'b'], index=[3, 4]), ['a', np.nan, 'b', 'a', 'b'])
45814581
])
4582-
def fillna_series_categorical(self, fill_value, expected_output):
4582+
def test_fillna_series_categorical(self, fill_value, expected_output):
45834583
# GH 17033
45844584
# Test fillna for a Categorical series
45854585
data = ['a', np.nan, 'b', np.nan, np.nan]
45864586
s = pd.Series(pd.Categorical(data, categories=['a', 'b']))
45874587
exp = pd.Series(pd.Categorical(expected_output, categories=['a', 'b']))
45884588
tm.assert_series_equal(s.fillna(fill_value), exp)
45894589

4590-
def fillna_series_categorical_errormsg(self):
4590+
def test_fillna_series_categorical_errormsg(self):
45914591
data = ['a', np.nan, 'b', np.nan, np.nan]
45924592
s = pd.Series(pd.Categorical(data, categories=['a', 'b']))
45934593

@@ -4605,7 +4605,7 @@ def fillna_series_categorical_errormsg(self):
46054605

46064606
with tm.assert_raises_regex(TypeError,
46074607
'"value" parameter must be a scalar or '
4608-
'dict but you passed a "list"'):
4608+
'dict, but you passed a "list"'):
46094609
s.fillna(['a', 'b'])
46104610

46114611
def test_astype_to_other(self):
@@ -4941,3 +4941,4 @@ def test_map(self):
49414941
assert isinstance(res, tm.SubclassedCategorical)
49424942
exp = Categorical(['A', 'B', 'C'])
49434943
tm.assert_categorical_equal(res, exp)
4944+

0 commit comments

Comments
 (0)