diff --git a/tests/test_logger.py b/tests/test_logger.py index df869fcec9..6bcb8c3460 100644 --- a/tests/test_logger.py +++ b/tests/test_logger.py @@ -154,6 +154,11 @@ class NewMessage(): with pytest.warns(DeprecationWarning) as warnings: deprecated_message_warning(OldMessage, NewMessage) - pattern = (r"The '(\w+)' message has been deprecated and will be removed " - r"after version (\d+\.\d+) release. Please use '(\w+)' instead.") - assert re.search(pattern, str(warnings[0].message)) is not None + pattern_with_version = (r"The '(\w+)' message has been deprecated and will be removed " + r"after version (\d+\.\d+) release. Please use '(\w+)' instead.") + + pattern_without_version = (r"The '(\w+)' message has been deprecated and will be removed " + r"after next version release. Please use '(\w+)' instead.") + + assert (re.search(pattern_with_version, str(warnings[0].message)) is not None) or\ + (re.search(pattern_without_version, str(warnings[0].message)))