Skip to content

Commit 31a1df1

Browse files
sliuosShawn Liu
and
Shawn Liu
authored
Add fixture docstring for series indexing (#59292)
* Add fixture docstring for series indexing * Make fixture docstring one line only --------- Co-authored-by: Shawn Liu <[email protected]>
1 parent 67a58cd commit 31a1df1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pandas/tests/series/indexing/test_setitem.py

+15
Original file line numberDiff line numberDiff line change
@@ -1178,25 +1178,40 @@ def test_setitem_example(self):
11781178

11791179
@pytest.fixture
11801180
def obj(self):
1181+
"""
1182+
Fixture to create a Series [(0, 1], (1, 2], (2, 3]]
1183+
"""
11811184
idx = IntervalIndex.from_breaks(range(4))
11821185
return Series(idx)
11831186

11841187
@pytest.fixture
11851188
def val(self):
1189+
"""
1190+
Fixture to get an interval (0.5, 1.5]
1191+
"""
11861192
return Interval(0.5, 1.5)
11871193

11881194
@pytest.fixture
11891195
def key(self):
1196+
"""
1197+
Fixture to get a key 0
1198+
"""
11901199
return 0
11911200

11921201
@pytest.fixture
11931202
def expected(self, obj, val):
1203+
"""
1204+
Fixture to get a Series [(0.5, 1.5], (1.0, 2.0], (2.0, 3.0]]
1205+
"""
11941206
data = [val] + list(obj[1:])
11951207
idx = IntervalIndex(data, dtype="Interval[float64]")
11961208
return Series(idx)
11971209

11981210
@pytest.fixture
11991211
def raises(self):
1212+
"""
1213+
Fixture to enable raising pytest exceptions
1214+
"""
12001215
return True
12011216

12021217

0 commit comments

Comments
 (0)