Skip to content

TST: Add nulls fixture to duplicates categorical na test #44407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pandas/tests/series/methods/test_drop_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import pytest

from pandas import (
NA,
Categorical,
Series,
)
Expand Down Expand Up @@ -225,11 +224,13 @@ def test_drop_duplicates_categorical_bool(self, ordered):
assert return_value is None
tm.assert_series_equal(sc, tc[~expected])

def test_drop_duplicates_categorical_bool_na(self):
def test_drop_duplicates_categorical_bool_na(self, nulls_fixture):
# GH#44351
ser = Series(
Categorical(
[True, False, True, False, NA], categories=[True, False], ordered=True
[True, False, True, False, nulls_fixture],
categories=[True, False],
ordered=True,
)
)
result = ser.drop_duplicates()
Expand Down
7 changes: 4 additions & 3 deletions pandas/tests/series/methods/test_duplicated.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import pytest

from pandas import (
NA,
Categorical,
Series,
)
Expand Down Expand Up @@ -39,11 +38,13 @@ def test_duplicated_nan_none(keep, expected):
tm.assert_series_equal(result, expected)


def test_duplicated_categorical_bool_na():
def test_duplicated_categorical_bool_na(nulls_fixture):
# GH#44351
ser = Series(
Categorical(
[True, False, True, False, NA], categories=[True, False], ordered=True
[True, False, True, False, nulls_fixture],
categories=[True, False],
ordered=True,
)
)
result = ser.duplicated()
Expand Down