fedora-infra / kitchen

Useful snippets of python code
GNU Lesser General Public License v2.1
33 stars 17 forks source link

Tests fail if LANGUAGE environment variable is set #20

Closed EdwardBetts closed 6 years ago

EdwardBetts commented 7 years ago

This is the output when running the test suite with python 3.6

edward@x1:~/src/2017/vendor/kitchen/kitchen3 (develop)$ python3.6 -mnose
...................................................................../home/edward/src/2017/vendor/kitchen/kitchen3/tests/base_classes.py:73: DeprecationWarning: invalid escape sequence \.
  repr_re = re.compile(b'^<[^ ]*\.([^.]+) object at .*>$')
....S................S.....................................F................................................................................................................................FFFFFFFFFFFF...................................................................................................................................FFF....FFFFFFFFFFFF.....................................................................................................................................F................S....................
======================================================================
FAIL: test_gettext (test_i18n.TestDefaultLocaleDir)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 805, in test_gettext
    tools.eq_(_(self.utf8_kitchen), self.utf8_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_gettext (test_i18n.TestFallbackNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 612, in test_gettext
    tools.eq_(_(self.utf8_kitchen), self.utf8_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lgettext (test_i18n.TestFallbackNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 714, in test_lgettext
    tools.eq_(_(self.utf8_kitchen), self.latin1_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lngettext (test_i18n.TestFallbackNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 731, in test_lngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.latin1_limao)
AssertionError: b'1 lemon' != b'? lim\xe3o'

======================================================================
FAIL: test_ngettext (test_i18n.TestFallbackNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 626, in test_ngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.utf8_limao)
AssertionError: b'1 lemon' != b'\xe4\xb8\x80 lim\xc3\xa3o'

======================================================================
FAIL: test_ugettext (test_i18n.TestFallbackNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 670, in test_ugettext
    tools.eq_(_(self.utf8_kitchen), self.u_pt_kitchen)
AssertionError: 'kitchen sink' != 'pia da cozinha'

======================================================================
FAIL: test_ungettext (test_i18n.TestFallbackNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 684, in test_ungettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.u_limao)
AssertionError: '1 lemon' != '一 limão'

======================================================================
FAIL: test_gettext (test_i18n.TestFallbackNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 612, in test_gettext
    tools.eq_(_(self.utf8_kitchen), self.utf8_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lgettext (test_i18n.TestFallbackNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 641, in test_lgettext
    tools.eq_(_(self.utf8_kitchen), self.utf8_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lngettext (test_i18n.TestFallbackNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 655, in test_lngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.utf8_limao)
AssertionError: b'1 lemon' != b'\xe4\xb8\x80 lim\xc3\xa3o'

======================================================================
FAIL: test_ngettext (test_i18n.TestFallbackNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 626, in test_ngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.utf8_limao)
AssertionError: b'1 lemon' != b'\xe4\xb8\x80 lim\xc3\xa3o'

======================================================================
FAIL: test_ugettext (test_i18n.TestFallbackNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 670, in test_ugettext
    tools.eq_(_(self.utf8_kitchen), self.u_pt_kitchen)
AssertionError: 'kitchen sink' != 'pia da cozinha'

======================================================================
FAIL: test_ungettext (test_i18n.TestFallbackNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 684, in test_ungettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.u_limao)
AssertionError: '1 lemon' != '一 limão'

======================================================================
FAIL: Test that the get_translation_object function works
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 67, in test_get_translation_object
    tools.eq_(translations.__class__, i18n.NewGNUTranslations)
AssertionError: <class 'kitchen.i18n.DummyTranslations'> != <class 'kitchen.i18n.NewGNUTranslations'>

======================================================================
FAIL: Test get_translation_object shallow copies the message catalog
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 91, in test_get_translation_object_copy
    tools.assert_not_equal(id(translations._fallback), id(translations2._fallback))
AssertionError: 10259328 == 10259328

======================================================================
FAIL: Test get_translation_object creates fallbacks for additional catalogs
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 74, in test_get_translation_object_create_fallback
    tools.eq_(translations.__class__, i18n.NewGNUTranslations)
AssertionError: <class 'kitchen.i18n.DummyTranslations'> != <class 'kitchen.i18n.NewGNUTranslations'>

======================================================================
FAIL: test_gettext (test_i18n.TestNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 429, in test_gettext
    tools.eq_(_(self.utf8_kitchen), self.utf8_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lgettext (test_i18n.TestNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 542, in test_lgettext
    tools.eq_(_(self.utf8_kitchen), self.latin1_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lngettext (test_i18n.TestNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 564, in test_lngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.latin1_limao)
AssertionError: b'1 lemon' != b'? lim\xe3o'

======================================================================
FAIL: test_ngettext (test_i18n.TestNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 447, in test_ngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.utf8_limao)
AssertionError: b'1 lemon' != b'\xe4\xb8\x80 lim\xc3\xa3o'

======================================================================
FAIL: test_ugettext (test_i18n.TestNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 496, in test_ugettext
    tools.eq_(_(self.utf8_kitchen), self.u_pt_kitchen)
AssertionError: 'kitchen sink' != 'pia da cozinha'

======================================================================
FAIL: test_ungettext (test_i18n.TestNewGNURealTranslations_Latin1)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 514, in test_ungettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.u_limao)
AssertionError: '1 lemon' != '一 limão'

======================================================================
FAIL: test_gettext (test_i18n.TestNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 429, in test_gettext
    tools.eq_(_(self.utf8_kitchen), self.utf8_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lgettext (test_i18n.TestNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 462, in test_lgettext
    tools.eq_(_(self.utf8_kitchen), self.utf8_pt_kitchen)
AssertionError: b'kitchen sink' != b'pia da cozinha'

======================================================================
FAIL: test_lngettext (test_i18n.TestNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 480, in test_lngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.utf8_limao)
AssertionError: b'1 lemon' != b'\xe4\xb8\x80 lim\xc3\xa3o'

======================================================================
FAIL: test_ngettext (test_i18n.TestNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 447, in test_ngettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.utf8_limao)
AssertionError: b'1 lemon' != b'\xe4\xb8\x80 lim\xc3\xa3o'

======================================================================
FAIL: test_ugettext (test_i18n.TestNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 496, in test_ugettext
    tools.eq_(_(self.utf8_kitchen), self.u_pt_kitchen)
AssertionError: 'kitchen sink' != 'pia da cozinha'

======================================================================
FAIL: test_ungettext (test_i18n.TestNewGNURealTranslations_UTF8)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_i18n.py", line 514, in test_ungettext
    tools.eq_(_(self.utf8_lemon, self.utf8_lemons, 1), self.u_limao)
AssertionError: '1 lemon' != '一 limão'

======================================================================
FAIL: Test that the combining table we generate is equal to or a subset of what's in the current table
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/edward/src/2017/vendor/kitchen/kitchen3/tests/test_text_display.py", line 46, in test_internal_generate_combining_table
    tools.assert_true(display._interval_bisearch(interval[0], old_table))
AssertionError: False is not true

----------------------------------------------------------------------
Ran 590 tests in 10.943s

FAILED (SKIP=3, failures=29)
edward@x1:~/src/2017/vendor/kitchen/kitchen3 (develop)$ 
EdwardBetts commented 7 years ago

I think part of the problem is that I have the LANGUAGE environment variable set. The gettext module looks at the value of LANGUAGE and ignores LC_ALL.