diff --git a/pandas/tests/computation/test_eval.py b/pandas/tests/computation/test_eval.py index 4c670e56613ed..3869bf8f7ddcd 100644 --- a/pandas/tests/computation/test_eval.py +++ b/pandas/tests/computation/test_eval.py @@ -117,7 +117,7 @@ def _is_py3_complex_incompat(result, expected): return isinstance(expected, (complex, np.complexfloating)) and np.isnan(result) -_good_arith_ops = set(ARITH_OPS_SYMS).difference(SPECIAL_CASE_ARITH_OPS_SYMS) +_good_arith_ops = sorted(set(ARITH_OPS_SYMS).difference(SPECIAL_CASE_ARITH_OPS_SYMS)) # TODO: using range(5) here is a kludge diff --git a/pandas/tests/frame/apply/test_frame_transform.py b/pandas/tests/frame/apply/test_frame_transform.py index 1b259ddbd41dc..d141fa8682c10 100644 --- a/pandas/tests/frame/apply/test_frame_transform.py +++ b/pandas/tests/frame/apply/test_frame_transform.py @@ -20,7 +20,7 @@ def test_transform_ufunc(axis, float_frame): tm.assert_frame_equal(result, expected) -@pytest.mark.parametrize("op", transformation_kernels) +@pytest.mark.parametrize("op", sorted(transformation_kernels)) def test_transform_groupby_kernel(axis, float_frame, op): # GH 35964 if op == "cumcount": @@ -161,7 +161,7 @@ def test_transform_reducer_raises(all_reductions): # mypy doesn't allow adding lists of different types # https://github.com/python/mypy/issues/5492 -@pytest.mark.parametrize("op", [*transformation_kernels, lambda x: x + 1]) +@pytest.mark.parametrize("op", [*sorted(transformation_kernels), lambda x: x + 1]) def test_transform_bad_dtype(op): # GH 35964 df = DataFrame({"A": 3 * [object]}) # DataFrame that will fail on most transforms @@ -182,7 +182,7 @@ def test_transform_bad_dtype(op): df.transform({"A": [op]}) -@pytest.mark.parametrize("op", transformation_kernels) +@pytest.mark.parametrize("op", sorted(transformation_kernels)) def test_transform_partial_failure(op): # GH 35964 wont_fail = ["ffill", "bfill", "fillna", "pad", "backfill", "shift"] diff --git a/pandas/tests/series/apply/test_series_transform.py b/pandas/tests/series/apply/test_series_transform.py index 67b271f757cfb..ada27289e795d 100644 --- a/pandas/tests/series/apply/test_series_transform.py +++ b/pandas/tests/series/apply/test_series_transform.py @@ -18,7 +18,7 @@ def test_transform_ufunc(string_series): tm.assert_series_equal(result, expected) -@pytest.mark.parametrize("op", transformation_kernels) +@pytest.mark.parametrize("op", sorted(transformation_kernels)) def test_transform_groupby_kernel(string_series, op): # GH 35964 if op == "cumcount": @@ -144,7 +144,7 @@ def test_transform_reducer_raises(all_reductions): # mypy doesn't allow adding lists of different types # https://github.com/python/mypy/issues/5492 -@pytest.mark.parametrize("op", [*transformation_kernels, lambda x: x + 1]) +@pytest.mark.parametrize("op", [*sorted(transformation_kernels), lambda x: x + 1]) def test_transform_bad_dtype(op): # GH 35964 s = Series(3 * [object]) # Series that will fail on most transforms