Skip to content

Commit

Permalink
userwarning repr on python3.6 adds a comma
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Oct 4, 2021
1 parent c727716 commit 7db2330
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/test_recwarn.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ def test_as_contextmanager(self) -> None:
warnings.warn("user", UserWarning)
excinfo.match(
r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) were emitted. \n"
r"The list of emitted warnings is: \[UserWarning\('user'\)\]."
r"The list of emitted warnings is: \[UserWarning\('user',?\)\]."
)

with pytest.raises(pytest.fail.Exception) as excinfo:
with pytest.warns(UserWarning):
warnings.warn("runtime", RuntimeWarning)
excinfo.match(
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. \n"
r"The list of emitted warnings is: \[RuntimeWarning\('runtime'\)]."
r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)]."
)

with pytest.raises(pytest.fail.Exception) as excinfo:
Expand Down

0 comments on commit 7db2330

Please sign in to comment.