Skip to content

Commit 4b7be33

Browse files
committed
TST: Parametrize expected output pandas-dev#31746
1 parent dfdddfa commit 4b7be33

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pandas/tests/series/test_reductions.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@
99
import pandas._testing as tm
1010

1111

12-
@pytest.mark.parametrize("operation", ["min", "max"])
13-
def test_reductions_series_strings(operation):
12+
@pytest.mark.parametrize("operation, expected", [("min", "a"), ("max", "b")])
13+
def test_reductions_series_strings(operation, expected):
1414
# GH#31746
15-
list_str = ["a", "b"]
16-
ser = Series(list_str, dtype="string")
15+
ser = Series(["a", "b"], dtype="string")
1716
res_operation_serie = getattr(ser, operation)()
18-
func_builtin_python = __builtins__[operation]
19-
res_builtin_python = func_builtin_python(list_str)
20-
assert res_operation_serie == res_builtin_python
17+
assert res_operation_serie == expected
2118

2219

2320
@pytest.mark.parametrize("as_period", [True, False])

0 commit comments

Comments
 (0)