From: Frédéric Pierret (fepitre) Date: Wed, 2 Dec 2020 10:30:10 +0000 (+0100) Subject: [PATCH] python tests: fix locale issues X-Git-Tag: archive/raspbian/0.73.4-1+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=86f19f8caddfc06a373f7ef6bf90d5da54a87648;p=libdnf.git [PATCH] python tests: fix locale issues It has been observed that manipulating locales in Debian environment, tests are failing. ====================================================================== ERROR: test_custom_querying (tests.test_reldep.Reldep) ---------------------------------------------------------------------- Traceback (most recent call last): File "/tmp/reprotest.wOQ8sL/build-experiment-1/build-experiment-1/python/hawkey/tests/tests/test_reldep.py", line 78, in test_custom_querying reldep = hawkey.Reldep(self.sack, u"\u0159 >= 3") _hawkey.ValueException: Wrong reldep format: \u0159 >= 3 Gbp-Pq: Name 0013-python-tests-fix-locale-issues.patch --- diff --git a/python/hawkey/tests/tests/base.py b/python/hawkey/tests/tests/base.py index 4d5937b..e46a1d6 100644 --- a/python/hawkey/tests/tests/base.py +++ b/python/hawkey/tests/tests/base.py @@ -33,6 +33,11 @@ if cachedir is None: cachedir = tempfile.mkdtemp(dir=os.path.dirname(hawkey.test.UNITTEST_DIR), prefix='pyhawkey') +# run tests with C locales +os.environ["LC_ALL"] = "C" +os.environ["LANG"] = "C.UTF-8" +os.environ["LANGUAGE"] = "en_US:en" + class TestCase(unittest.TestCase): repo_dir = os.path.normpath(os.path.join(__file__, "../../../../../data/tests/hawkey/"))