Skip to content

Commit eec47a1

Browse files
authored
TST: Remove unnecessary pytest fixture scopes (#49424)
1 parent c9fc7fc commit eec47a1

File tree

8 files changed

+8
-15
lines changed

8 files changed

+8
-15
lines changed

pandas/tests/arithmetic/conftest.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
from pandas.core.computation import expressions as expr
1313

1414

15-
@pytest.fixture(
16-
autouse=True, scope="module", params=[0, 1000000], ids=["numexpr", "python"]
17-
)
15+
@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
1816
def switch_numexpr_min_elements(request):
1917
_MIN_ELEMENTS = expr._MIN_ELEMENTS
2018
expr._MIN_ELEMENTS = request.param

pandas/tests/frame/test_arithmetic.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131
)
3232

3333

34-
@pytest.fixture(
35-
autouse=True, scope="module", params=[0, 1000000], ids=["numexpr", "python"]
36-
)
34+
@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
3735
def switch_numexpr_min_elements(request):
3836
_MIN_ELEMENTS = expr._MIN_ELEMENTS
3937
expr._MIN_ELEMENTS = request.param

pandas/tests/frame/test_query_eval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ def test_invalid_type_for_operator_raises(self, parser, engine, op):
11121112

11131113

11141114
class TestDataFrameQueryBacktickQuoting:
1115-
@pytest.fixture(scope="class")
1115+
@pytest.fixture
11161116
def df(self):
11171117
"""
11181118
Yields a dataframe with strings that may or may not need escaping

pandas/tests/indexes/interval/test_interval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import pandas.core.common as com
2323

2424

25-
@pytest.fixture(scope="class", params=[None, "foo"])
25+
@pytest.fixture(params=[None, "foo"])
2626
def name(request):
2727
return request.param
2828

pandas/tests/indexes/interval/test_interval_range.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from pandas.tseries.offsets import Day
2121

2222

23-
@pytest.fixture(scope="class", params=[None, "foo"])
23+
@pytest.fixture(params=[None, "foo"])
2424
def name(request):
2525
return request.param
2626

pandas/tests/indexes/interval/test_interval_tree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def skipif_32bit(param):
1818
return pytest.param(param, marks=marks)
1919

2020

21-
@pytest.fixture(scope="class", params=["int64", "float64", "uint64"])
21+
@pytest.fixture(params=["int64", "float64", "uint64"])
2222
def dtype(request):
2323
return request.param
2424

pandas/tests/io/test_html.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def test_same_ordering(datapath):
101101
pytest.param("bs4", marks=[td.skip_if_no("bs4"), td.skip_if_no("html5lib")]),
102102
pytest.param("lxml", marks=td.skip_if_no("lxml")),
103103
],
104-
scope="class",
105104
)
106105
class TestReadHtml:
107106
@pytest.fixture
@@ -112,7 +111,7 @@ def spam_data(self, datapath):
112111
def banklist_data(self, datapath):
113112
return datapath("io", "data", "html", "banklist.html")
114113

115-
@pytest.fixture(autouse=True, scope="function")
114+
@pytest.fixture(autouse=True)
116115
def set_defaults(self, flavor):
117116
self.read_html = partial(read_html, flavor=flavor)
118117
yield

pandas/tests/series/test_arithmetic.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
from pandas.core.computation import expressions as expr
3131

3232

33-
@pytest.fixture(
34-
autouse=True, scope="module", params=[0, 1000000], ids=["numexpr", "python"]
35-
)
33+
@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
3634
def switch_numexpr_min_elements(request):
3735
_MIN_ELEMENTS = expr._MIN_ELEMENTS
3836
expr._MIN_ELEMENTS = request.param

0 commit comments

Comments
 (0)