Skip to content

Commit

Permalink
Add docstrings to fixtures in /indexes/datetimelike_/test_drop_duplic…
Browse files Browse the repository at this point in the history
…ates.py
  • Loading branch information
ivonastojanovic committed Jul 17, 2024
1 parent d966462 commit 4bc6e84
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion pandas/tests/series/methods/test_drop_duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,22 @@ class TestSeriesDropDuplicates:
params=["int_", "uint", "float64", "str_", "timedelta64[h]", "datetime64[D]"]
)
def dtype(self, request):
"""
Fixture that provides different data types for testing.
The parameterized fixture returns various numpy data types including
integer, unsigned integer, float, string, timedelta, and datetime.
"""
return request.param

@pytest.fixture
def cat_series_unused_category(self, dtype, ordered):
"""
Fixture that creates a Categorical Series with some unused categories.
This fixture creates a Categorical Series based on the given dtype and
ordered parameters. The input series contains some categories that are
not used in the actual data, allowing the testing of categorical
behavior with unused categories.
"""
# Test case 1
cat_array = np.array([1, 2, 3, 4, 5], dtype=np.dtype(dtype))

Expand Down Expand Up @@ -141,7 +153,13 @@ def test_drop_duplicates_categorical_non_bool_keepfalse(

@pytest.fixture
def cat_series(self, dtype, ordered):
# no unused categories, unlike cat_series_unused_category
"""
Fixture that creates a Categorical Series with no unused categories.
This fixture creates a Categorical Series based on the given dtype and
ordered parameters. The input series contains categories that are all
used in the actual data, allowing the testing of categorical behavior
without unused categories.
"""
cat_array = np.array([1, 2, 3, 4, 5], dtype=np.dtype(dtype))

input2 = np.array([1, 2, 3, 5, 3, 2, 4], dtype=np.dtype(dtype))
Expand Down

0 comments on commit 4bc6e84

Please sign in to comment.