Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
yczhang-nv committed May 30, 2024
1 parent 7d886ef commit c8cfbca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

0 comments on commit c8cfbca

Please sign in to comment.