We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fa3c5d commit d4b6b67Copy full SHA for d4b6b67
1 file changed
tests/conftest.py
@@ -13,10 +13,6 @@
13
import bugzilla
14
15
16
-# Use consistent locale for tests
17
-locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
18
-
19
20
# pytest plugin adding custom options. Hooks are documented here:
21
# https://docs.pytest.org/en/latest/writing_plugins.html
22
@@ -61,6 +57,13 @@ def pytest_ignore_collect(path, config):
61
57
62
58
63
59
def pytest_configure(config):
60
+ try:
+ # Needed for test reproducibility on systems not using a UTF-8 locale
+ locale.setlocale(locale.LC_ALL, 'C')
+ locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
64
+ except Exception as e:
65
+ print("Error setting locale: %s" % str(e))
66
+
67
if config.getoption("--redhat-url"):
68
tests.CLICONFIG.REDHAT_URL = config.getoption("--redhat-url")
69
if config.getoption("--pybz-debug"):
0 commit comments