[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libosinfo] [osinfo-db PATCH] test: conftest: Set LC_ALL



Based on Dan's comment: "This doesn't actually do the same as the
makefile code. This still uses the user's own locale for everything that
isn't LC_CTYPE. The make code explicitly forced C locale to ensure
reproducable environment that does not vary per user locale.", let's
force the C locale.

Also based on Dan's comment: "This isn't a freebsd problem. It will hit
any user who is not using a UTF-8 locale.", let's adjust the comment
explaining why we need to have LC_ALL and LC_CTYPE set.

Signed-off-by: Fabiano Fidêncio <fidencio redhat com>
---
 tests/conftest.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/conftest.py b/tests/conftest.py
index ade36c5..a6cb20a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -17,7 +17,8 @@ def pytest_configure(config):
         os.environ[key] = os.path.realpath(os.path.join(
             os.path.dirname(__file__), "..", "data"))
 
-    # Needed for test reproducibility on freebsd
+    # Needed for test reproducibility on any system not using a UTF-8 locale
+    locale.setlocale(locale.LC_ALL, 'C')
     locale.setlocale(locale.LC_CTYPE, 'en_US.UTF-8')
 
     # Default to --log-level=info if not otherwise specified
-- 
2.20.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]