Skip to content

Commit 26cb294

Browse files
committed
Move locale fixture to pandas/conftest
1 parent 2ea1bd6 commit 26cb294

File tree

6 files changed

+9
-38
lines changed

6 files changed

+9
-38
lines changed

pandas/conftest.py

+9
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ def add_imports(doctest_namespace):
199199
doctest_namespace["pd"] = pd
200200

201201

202+
@pytest.fixture(params=tm.TESTING_LOCALES, autouse=True)
203+
def configure_locale(request):
204+
"""
205+
Ensure tests are run on multiple locales if available.
206+
"""
207+
with tm.set_locale(request.param):
208+
yield
209+
210+
202211
# ----------------------------------------------------------------
203212
# Common arguments
204213
# ----------------------------------------------------------------

pandas/tests/frame/conftest.py

-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
import pandas._testing as tm
1010

1111

12-
@pytest.fixture(params=tm.TESTING_LOCALES, autouse=True)
13-
def with_locale(request):
14-
with tm.set_locale(request.param):
15-
yield
16-
17-
1812
@pytest.fixture
1913
def float_frame_with_na():
2014
"""

pandas/tests/io/conftest.py

-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
from pandas.io.parsers import read_csv
1818

1919

20-
@pytest.fixture(params=tm.TESTING_LOCALES, autouse=True)
21-
def with_locale(request):
22-
with tm.set_locale(request.param):
23-
yield
24-
25-
2620
@pytest.fixture
2721
def tips_file(datapath):
2822
"""Path to the tips dataset"""

pandas/tests/strings/conftest.py

-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,8 @@
22
import pytest
33

44
from pandas import Series
5-
import pandas._testing as tm
65
from pandas.core import strings as strings
76

8-
9-
@pytest.fixture(params=tm.TESTING_LOCALES, autouse=True)
10-
def with_locale(request):
11-
with tm.set_locale(request.param):
12-
yield
13-
14-
157
_any_string_method = [
168
("cat", (), {"sep": ","}),
179
("cat", (Series(list("zyx")),), {"sep": ",", "join": "left"}),

pandas/tests/tools/conftest.py

-9
This file was deleted.

pandas/tests/tslibs/conftest.py

-9
This file was deleted.

0 commit comments

Comments
 (0)