danhper / danhper/python-i18n

Translation tests failing

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
246
Forks
46
PR merge metrics
No merged PRs in 30d

Description

These tests are failing for me on Python 3.8 & 3.10. They used to pass iirc, so that only cause could be Python version or using latest PyYAML.

```py
...
i18n/tests/translation_tests.py FFF..F.FFFF..... [100%]

================================================================================================================= FAILURES ==================================================================================================================
_______________________________________________________________________________________________ TestTranslationFormat.test_bad_pluralization ________________________________________________________________________________________________

self =

def test_bad_pluralization(self):
config.set('error_on_missing_plural', False)
self.assertEqual(t('foo.normal_key', count=5), 'normal_value')
config.set('error_on_missing_plural', True)
> with self.assertRaises(KeyError):
E AssertionError: KeyError not raised

i18n/tests/translation_tests.py:102: AssertionError
_______________________________________________________________________________________________ TestTranslationFormat.test_basic_placeholder ________________________________________________________________________________________________

self =

def test_basic_placeholder(self):
> self.assertEqual(t('foo.hi', name='Bob'), 'Hello Bob !')
E AssertionError: 'foo.hi' != 'Hello Bob !'
E - foo.hi
E + Hello Bob !

i18n/tests/translation_tests.py:77: AssertionError
______________________________________________________________________________________________ TestTranslationFormat.test_basic_pluralization _______________________________________________________________________________________________

self =

def test_basic_pluralization(self):
> self.assertEqual(t('foo.basic_plural', count=0), '0 elems')
E AssertionError: 'foo.basic_plural' != '0 elems'
E - foo.basic_plural
E + 0 elems

i18n/tests/translation_tests.py:88: AssertionError
____________________________________________________________________________________________________ TestTranslationFormat.test_fallback ____________________________________________________________________________________________________

self =

def test_fallback(self):
config.set('fallback', 'fr')
> self.assertEqual(t('foo.hello', name='Bob'), 'Salut Bob !')
E AssertionError: 'foo.hello' != 'Salut Bob !'
E - foo.hello
E + Salut Bob !

i18n/tests/translation_tests.py:70: AssertionError
_______________________________________________________________________________________________ TestTranslationFormat.test_full_pluralization _______________________________________________________________________________________________

self =

def test_full_pluralization(self):
> self.assertEqual(t('foo.plural', count=0), 'no mail')
E AssertionError: 'foo.plural' != 'no mail'
E - foo.plural
E + no mail

i18n/tests/translation_tests.py:93: AssertionError
_________________________________________________________________________________________________ TestTranslationFormat.test_locale_change __________________________________________________________________________________________________

self =

def test_locale_change(self):
config.set('locale', 'fr')
> self.assertEqual(t('foo.hello', name='Bob'), 'Salut Bob !')
E AssertionError: 'foo.hello' != 'Salut Bob !'
E - foo.hello
E + Salut Bob !

i18n/tests/translation_tests.py:66: AssertionError
_______________________________________________________________________________________________ TestTranslationFormat.test_missing_placehoder _______________________________________________________________________________________________

self =

def test_missing_placehoder(self):
> self.assertEqual(t('foo.hi'), 'Hello %{name} !')
E AssertionError: 'foo.hi' != 'Hello %{name} !'
E - foo.hi
E + Hello %{name} !

i18n/tests/translation_tests.py:80: AssertionError
___________________________________________________________________________________________ TestTranslationFormat.test_missing_placeholder_error ____________________________________________________________________________________________

self =

def test_missing_placeholder_error(self):
config.set('error_on_missing_placeholder', True)
> with self.assertRaises(KeyError):
E AssertionError: KeyError not raised
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.