From 31a1df1d62fb5760dc85a5e955635d739ed22072 Mon Sep 17 00:00:00 2001 From: sliuos <175488904+sliuos@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:31:50 -0400 Subject: [PATCH] Add fixture docstring for series indexing (#59292) * Add fixture docstring for series indexing * Make fixture docstring one line only --------- Co-authored-by: Shawn Liu --- pandas/tests/series/indexing/test_setitem.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandas/tests/series/indexing/test_setitem.py b/pandas/tests/series/indexing/test_setitem.py index 253339f8a6446..62f2c93ef691a 100644 --- a/pandas/tests/series/indexing/test_setitem.py +++ b/pandas/tests/series/indexing/test_setitem.py @@ -1178,25 +1178,40 @@ def test_setitem_example(self): @pytest.fixture def obj(self): + """ + Fixture to create a Series [(0, 1], (1, 2], (2, 3]] + """ idx = IntervalIndex.from_breaks(range(4)) return Series(idx) @pytest.fixture def val(self): + """ + Fixture to get an interval (0.5, 1.5] + """ return Interval(0.5, 1.5) @pytest.fixture def key(self): + """ + Fixture to get a key 0 + """ return 0 @pytest.fixture def expected(self, obj, val): + """ + Fixture to get a Series [(0.5, 1.5], (1.0, 2.0], (2.0, 3.0]] + """ data = [val] + list(obj[1:]) idx = IntervalIndex(data, dtype="Interval[float64]") return Series(idx) @pytest.fixture def raises(self): + """ + Fixture to enable raising pytest exceptions + """ return True