From 37fdb3effdb11d9e2a43f695decdfd296c03ff7f Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Sun, 30 Oct 2022 20:03:14 -0700 Subject: [PATCH] TST: Remove unnecessary scope --- pandas/tests/arithmetic/conftest.py | 4 +--- pandas/tests/frame/test_arithmetic.py | 4 +--- pandas/tests/frame/test_query_eval.py | 2 +- pandas/tests/indexes/interval/test_interval.py | 2 +- pandas/tests/indexes/interval/test_interval_range.py | 2 +- pandas/tests/indexes/interval/test_interval_tree.py | 2 +- pandas/tests/io/test_html.py | 3 +-- pandas/tests/series/test_arithmetic.py | 4 +--- 8 files changed, 8 insertions(+), 15 deletions(-) diff --git a/pandas/tests/arithmetic/conftest.py b/pandas/tests/arithmetic/conftest.py index e847f31cd3f9c..b734344d25174 100644 --- a/pandas/tests/arithmetic/conftest.py +++ b/pandas/tests/arithmetic/conftest.py @@ -12,9 +12,7 @@ from pandas.core.computation import expressions as expr -@pytest.fixture( - autouse=True, scope="module", params=[0, 1000000], ids=["numexpr", "python"] -) +@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"]) def switch_numexpr_min_elements(request): _MIN_ELEMENTS = expr._MIN_ELEMENTS expr._MIN_ELEMENTS = request.param diff --git a/pandas/tests/frame/test_arithmetic.py b/pandas/tests/frame/test_arithmetic.py index 9fc3161a7b004..822e761f63ae8 100644 --- a/pandas/tests/frame/test_arithmetic.py +++ b/pandas/tests/frame/test_arithmetic.py @@ -31,9 +31,7 @@ ) -@pytest.fixture( - autouse=True, scope="module", params=[0, 1000000], ids=["numexpr", "python"] -) +@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"]) def switch_numexpr_min_elements(request): _MIN_ELEMENTS = expr._MIN_ELEMENTS expr._MIN_ELEMENTS = request.param diff --git a/pandas/tests/frame/test_query_eval.py b/pandas/tests/frame/test_query_eval.py index 4da57fc177712..e81837898c927 100644 --- a/pandas/tests/frame/test_query_eval.py +++ b/pandas/tests/frame/test_query_eval.py @@ -1112,7 +1112,7 @@ def test_invalid_type_for_operator_raises(self, parser, engine, op): class TestDataFrameQueryBacktickQuoting: - @pytest.fixture(scope="class") + @pytest.fixture def df(self): """ Yields a dataframe with strings that may or may not need escaping diff --git a/pandas/tests/indexes/interval/test_interval.py b/pandas/tests/indexes/interval/test_interval.py index 37c13c37d070b..5d077f014dc89 100644 --- a/pandas/tests/indexes/interval/test_interval.py +++ b/pandas/tests/indexes/interval/test_interval.py @@ -22,7 +22,7 @@ import pandas.core.common as com -@pytest.fixture(scope="class", params=[None, "foo"]) +@pytest.fixture(params=[None, "foo"]) def name(request): return request.param diff --git a/pandas/tests/indexes/interval/test_interval_range.py b/pandas/tests/indexes/interval/test_interval_range.py index 2f28c33a3bbc6..18b5af00c8d5d 100644 --- a/pandas/tests/indexes/interval/test_interval_range.py +++ b/pandas/tests/indexes/interval/test_interval_range.py @@ -20,7 +20,7 @@ from pandas.tseries.offsets import Day -@pytest.fixture(scope="class", params=[None, "foo"]) +@pytest.fixture(params=[None, "foo"]) def name(request): return request.param diff --git a/pandas/tests/indexes/interval/test_interval_tree.py b/pandas/tests/indexes/interval/test_interval_tree.py index 3b9de8d9e45d9..45b25f2533afd 100644 --- a/pandas/tests/indexes/interval/test_interval_tree.py +++ b/pandas/tests/indexes/interval/test_interval_tree.py @@ -18,7 +18,7 @@ def skipif_32bit(param): return pytest.param(param, marks=marks) -@pytest.fixture(scope="class", params=["int64", "float64", "uint64"]) +@pytest.fixture(params=["int64", "float64", "uint64"]) def dtype(request): return request.param diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index 0ea1203359153..dcfec8848849f 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -101,7 +101,6 @@ def test_same_ordering(datapath): pytest.param("bs4", marks=[td.skip_if_no("bs4"), td.skip_if_no("html5lib")]), pytest.param("lxml", marks=td.skip_if_no("lxml")), ], - scope="class", ) class TestReadHtml: @pytest.fixture @@ -112,7 +111,7 @@ def spam_data(self, datapath): def banklist_data(self, datapath): return datapath("io", "data", "html", "banklist.html") - @pytest.fixture(autouse=True, scope="function") + @pytest.fixture(autouse=True) def set_defaults(self, flavor): self.read_html = partial(read_html, flavor=flavor) yield diff --git a/pandas/tests/series/test_arithmetic.py b/pandas/tests/series/test_arithmetic.py index c8044a44b48ee..37711054f2285 100644 --- a/pandas/tests/series/test_arithmetic.py +++ b/pandas/tests/series/test_arithmetic.py @@ -30,9 +30,7 @@ from pandas.core.computation import expressions as expr -@pytest.fixture( - autouse=True, scope="module", params=[0, 1000000], ids=["numexpr", "python"] -) +@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"]) def switch_numexpr_min_elements(request): _MIN_ELEMENTS = expr._MIN_ELEMENTS expr._MIN_ELEMENTS = request.param