Skip to content

Commit f46df09

Browse files
authored
TST: Remove unused fixtures (#45692)
* TST: Remove unused fixtures * Undo a removed fixture * Add back other fixtures * Undo a file * Try undoing this? * Revert "Try undoing this?" This reverts commit 0e56cb0.
1 parent c44b561 commit f46df09

File tree

75 files changed

+135
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+135
-147
lines changed

pandas/tests/apply/test_str.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_with_string_args(datetime_series):
5555

5656
@pytest.mark.parametrize("op", ["mean", "median", "std", "var"])
5757
@pytest.mark.parametrize("how", ["agg", "apply"])
58-
def test_apply_np_reducer(float_frame, op, how):
58+
def test_apply_np_reducer(op, how):
5959
# GH 39116
6060
float_frame = DataFrame({"a": [1, 2], "b": [3, 4]})
6161
result = getattr(float_frame, how)(op)

pandas/tests/arrays/categorical/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class TestCategorical:
5-
def setup_method(self, method):
5+
def setup_method(self):
66
self.factor = Categorical(
77
["a", "b", "b", "a", "a", "c", "c", "c"], ordered=True
88
)

pandas/tests/arrays/categorical/test_indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def array(self, dtype=None):
370370
yield
371371

372372

373-
def test_series_at(non_coercible_categorical):
373+
def test_series_at():
374374
arr = Categorical(["a", "b", "c"])
375375
ser = Series(arr)
376376
result = ser.at[0]

pandas/tests/arrays/masked/test_arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_error_len_mismatch(data, all_arithmetic_operators):
173173

174174

175175
@pytest.mark.parametrize("op", ["__neg__", "__abs__", "__invert__"])
176-
def test_unary_op_does_not_propagate_mask(data, op, request):
176+
def test_unary_op_does_not_propagate_mask(data, op):
177177
# https://github.com/pandas-dev/pandas/issues/39943
178178
data, _ = data
179179
ser = pd.Series(data)

pandas/tests/arrays/sparse/test_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
class TestSparseArray:
20-
def setup_method(self, method):
20+
def setup_method(self):
2121
self.arr_data = np.array([np.nan, np.nan, 1, 2, 3, np.nan, 4, 5, np.nan, 6])
2222
self.arr = SparseArray(self.arr_data)
2323
self.zarr = SparseArray([0, 0, 1, 2, 3, 0, 4, 5, 0, 6], fill_value=0)

pandas/tests/arrays/string_/test_string.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ def test_to_numpy_na_value(dtype, nulls_fixture):
554554
tm.assert_numpy_array_equal(result, expected)
555555

556556

557-
def test_isin(dtype, request, fixed_now_ts):
557+
def test_isin(dtype, fixed_now_ts):
558558
s = pd.Series(["a", "b", None], dtype=dtype)
559559

560560
result = s.isin(["a", "c"])

pandas/tests/config/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setup_class(cls):
1818
cls.do = deepcopy(getattr(cls.cf, "_deprecated_options"))
1919
cls.ro = deepcopy(getattr(cls.cf, "_registered_options"))
2020

21-
def setup_method(self, method):
21+
def setup_method(self):
2222
setattr(self.cf, "_global_config", {})
2323
setattr(self.cf, "options", self.cf.DictWrapper(self.cf._global_config))
2424
setattr(self.cf, "_deprecated_options", {})
@@ -30,7 +30,7 @@ def setup_method(self, method):
3030
# "chained_assignment" option, so re-register it.
3131
self.cf.register_option("chained_assignment", "raise")
3232

33-
def teardown_method(self, method):
33+
def teardown_method(self):
3434
setattr(self.cf, "_global_config", self.gc)
3535
setattr(self.cf, "_deprecated_options", self.do)
3636
setattr(self.cf, "_registered_options", self.ro)

pandas/tests/dtypes/cast/test_promote.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def test_maybe_promote_bytes_with_any(bytes_dtype, any_numpy_dtype_reduced):
348348
_check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar)
349349

350350

351-
def test_maybe_promote_any_with_bytes(any_numpy_dtype_reduced, bytes_dtype):
351+
def test_maybe_promote_any_with_bytes(any_numpy_dtype_reduced):
352352
dtype = np.dtype(any_numpy_dtype_reduced)
353353

354354
# create array of given dtype
@@ -391,9 +391,7 @@ def test_maybe_promote_datetime64_with_any(datetime64_dtype, any_numpy_dtype_red
391391
],
392392
ids=["pd.Timestamp", "np.datetime64", "datetime.datetime", "datetime.date"],
393393
)
394-
def test_maybe_promote_any_with_datetime64(
395-
any_numpy_dtype_reduced, datetime64_dtype, fill_value
396-
):
394+
def test_maybe_promote_any_with_datetime64(any_numpy_dtype_reduced, fill_value):
397395
dtype = np.dtype(any_numpy_dtype_reduced)
398396

399397
# filling datetime with anything but datetime casts to object
@@ -465,9 +463,7 @@ def test_maybe_promote_timedelta64_with_any(timedelta64_dtype, any_numpy_dtype_r
465463
[pd.Timedelta(days=1), np.timedelta64(24, "h"), datetime.timedelta(1)],
466464
ids=["pd.Timedelta", "np.timedelta64", "datetime.timedelta"],
467465
)
468-
def test_maybe_promote_any_with_timedelta64(
469-
any_numpy_dtype_reduced, timedelta64_dtype, fill_value
470-
):
466+
def test_maybe_promote_any_with_timedelta64(any_numpy_dtype_reduced, fill_value):
471467
dtype = np.dtype(any_numpy_dtype_reduced)
472468

473469
# filling anything but timedelta with timedelta casts to object
@@ -496,7 +492,7 @@ def test_maybe_promote_string_with_any(string_dtype, any_numpy_dtype_reduced):
496492
_check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar)
497493

498494

499-
def test_maybe_promote_any_with_string(any_numpy_dtype_reduced, string_dtype):
495+
def test_maybe_promote_any_with_string(any_numpy_dtype_reduced):
500496
dtype = np.dtype(any_numpy_dtype_reduced)
501497

502498
# create array of given dtype
@@ -523,7 +519,7 @@ def test_maybe_promote_object_with_any(object_dtype, any_numpy_dtype_reduced):
523519
_check_promote(dtype, fill_value, expected_dtype, exp_val_for_scalar)
524520

525521

526-
def test_maybe_promote_any_with_object(any_numpy_dtype_reduced, object_dtype):
522+
def test_maybe_promote_any_with_object(any_numpy_dtype_reduced):
527523
dtype = np.dtype(any_numpy_dtype_reduced)
528524

529525
# create array of object dtype from a scalar value (i.e. passing

pandas/tests/dtypes/test_dtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ def test_categories(self):
848848
tm.assert_index_equal(result.categories, pd.Index(["a", "b", "c"]))
849849
assert result.ordered is False
850850

851-
def test_equal_but_different(self, ordered):
851+
def test_equal_but_different(self):
852852
c1 = CategoricalDtype([1, 2, 3])
853853
c2 = CategoricalDtype([1.0, 2.0, 3.0])
854854
assert c1 is not c2

pandas/tests/extension/base/setitem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def test_setitem_series(self, data, full_indexer):
357357
)
358358
self.assert_series_equal(result, expected)
359359

360-
def test_setitem_frame_2d_values(self, data, request):
360+
def test_setitem_frame_2d_values(self, data):
361361
# GH#44514
362362
df = pd.DataFrame({"A": data})
363363
orig = df.copy()

0 commit comments

Comments
 (0)