Skip to content

Commit 183a416

Browse files
Anjali2019jreback
authored andcommitted
TST: Fixturize series/test_validate.py (#22756)
1 parent 3ab9dbd commit 183a416

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pandas/tests/series/test_validate.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1-
from pandas.core.series import Series
2-
31
import pytest
42
import pandas.util.testing as tm
53

64

7-
@pytest.fixture
8-
def series():
9-
return Series([1, 2, 3, 4, 5])
10-
11-
125
class TestSeriesValidate(object):
136
"""Tests for error handling related to data types of method arguments."""
147

158
@pytest.mark.parametrize("func", ["reset_index", "_set_name",
169
"sort_values", "sort_index",
1710
"rename", "dropna"])
1811
@pytest.mark.parametrize("inplace", [1, "True", [1, 2, 3], 5.0])
19-
def test_validate_bool_args(self, series, func, inplace):
12+
def test_validate_bool_args(self, string_series, func, inplace):
2013
msg = "For argument \"inplace\" expected type bool"
2114
kwargs = dict(inplace=inplace)
2215

2316
if func == "_set_name":
2417
kwargs["name"] = "hello"
2518

2619
with tm.assert_raises_regex(ValueError, msg):
27-
getattr(series, func)(**kwargs)
20+
getattr(string_series, func)(**kwargs)

0 commit comments

Comments
 (0)