diff --git a/pandas/tests/reductions/test_reductions.py b/pandas/tests/reductions/test_reductions.py index 66f263b84de4d..8888e2687621d 100644 --- a/pandas/tests/reductions/test_reductions.py +++ b/pandas/tests/reductions/test_reductions.py @@ -924,10 +924,9 @@ def test_all_any(self): s = Series(["abc", True]) assert s.any() - @pytest.mark.parametrize("klass", [Index, Series]) - def test_numpy_all_any(self, klass): + def test_numpy_all_any(self, index_or_series): # GH#40180 - idx = klass([0, 1, 2]) + idx = index_or_series([0, 1, 2]) assert not np.all(idx) assert np.any(idx) idx = Index([1, 2, 3]) diff --git a/pandas/tests/reshape/concat/test_append_common.py b/pandas/tests/reshape/concat/test_append_common.py index 527ec43437469..e0275fa85d66e 100644 --- a/pandas/tests/reshape/concat/test_append_common.py +++ b/pandas/tests/reshape/concat/test_append_common.py @@ -70,11 +70,10 @@ def _check_expected_dtype(self, obj, label): else: raise ValueError - @pytest.mark.parametrize("box", [Index, Series]) - def test_dtypes(self, item, box): + def test_dtypes(self, item, index_or_series): # to confirm test case covers intended dtypes typ, vals = item - obj = box(vals) + obj = index_or_series(vals) if isinstance(obj, Index): assert obj.dtype == typ elif isinstance(obj, Series): diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index 7db740e36d3a9..1d092d9563f00 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -67,7 +67,6 @@ def test_to_datetime_readonly(self, readonly): expected = to_datetime([]) tm.assert_index_equal(result, expected) - @pytest.mark.parametrize("box", [Series, Index]) @pytest.mark.parametrize( "format, expected", [ @@ -81,10 +80,10 @@ def test_to_datetime_readonly(self, readonly): ], ], ) - def test_to_datetime_format(self, cache, box, format, expected): - values = box(["1/1/2000", "1/2/2000", "1/3/2000"]) + def test_to_datetime_format(self, cache, index_or_series, format, expected): + values = index_or_series(["1/1/2000", "1/2/2000", "1/3/2000"]) result = to_datetime(values, format=format, cache=cache) - expected = box(expected) + expected = index_or_series(expected) if isinstance(expected, Series): tm.assert_series_equal(result, expected) else: