On python 3.11, we have some more warnings (deprecation warnings), so the count is >=1 --- a/oslo_i18n/tests/test_message.py +++ b/oslo_i18n/tests/test_message.py @@ -386,7 +386,7 @@ class MessageTestCase(test_base.BaseTestCase): self.assertEqual(default_translation, msg.translation('es')) - self.assertEqual(1, len(w)) + self.assertLessEqual(1, len(w)) # 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 +394,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 '