Group :: Development/Python3
RPM: python3-module-oslo.i18n
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: oslo.i18n-6.0.0-alt-fix-tests-for-python-3.11.patch
Download
Download
diff --git a/oslo.i18n/oslo_i18n/tests/test_message.py b/oslo.i18n/oslo_i18n/tests/test_message.py
index 2436a25..d9d4b8e 100644
--- a/oslo.i18n/oslo_i18n/tests/test_message.py
+++ b/oslo.i18n/oslo_i18n/tests/test_message.py
@@ -386,7 +386,10 @@ class MessageTestCase(test_base.BaseTestCase):
self.assertEqual(default_translation, msg.translation('es'))
- self.assertEqual(1, len(w))
+ self.assertLessEqual(len(w), 2)
+ self.assertLessEqual(1, len(w))
+ if len(w) == 2:
+ self.assertEqual(w[0].category, DeprecationWarning)
# Note(gibi): in python 3.4 str.__repr__ does not put the unicode
# marker 'u' in front of the string representations so the test
# removes that to have the same result in python 2.7 and 3.4
@@ -394,7 +397,7 @@ class MessageTestCase(test_base.BaseTestCase):
"translated message A message in Spanish: %s %s "
"(Original: 'A message: %s'): "
"not enough arguments for format string",
- str(w[0].message).replace("u'", "'"))
+ str(w[-1].message).replace("u'", "'"))
mock_log.debug.assert_called_with(('Failed to insert replacement '
'values into translated message '