recwarn: fix was -> were in DID NOT WARN message

This commit is contained in:
Ran Benita 2021-10-23 23:17:35 +03:00
parent 60ca83746b
commit 99363ad7ff
3 changed files with 8 additions and 8 deletions

View File

@ -268,7 +268,7 @@ argument ``match`` to assert that the exception matches a text or regex::
... warnings.warn("this is not here", UserWarning)
Traceback (most recent call last):
...
Failed: DID NOT WARN. No warnings of type ...UserWarning... was emitted...
Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted...
You can also call :func:`pytest.warns` on a function or code string:

View File

@ -136,7 +136,7 @@ def warns(
... warnings.warn("this is not here", UserWarning)
Traceback (most recent call last):
...
Failed: DID NOT WARN. No warnings of type ...UserWarning... was emitted...
Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted...
"""
__tracebackhide__ = True
@ -274,7 +274,7 @@ class WarningsChecker(WarningsRecorder):
if not any(issubclass(r.category, self.expected_warning) for r in self):
__tracebackhide__ = True
fail(
"DID NOT WARN. No warnings of type {} was emitted. "
"DID NOT WARN. No warnings of type {} were emitted. "
"The list of emitted warnings is: {}.".format(
self.expected_warning, [each.message for each in self]
)
@ -287,7 +287,7 @@ class WarningsChecker(WarningsRecorder):
else:
fail(
"DID NOT WARN. No warnings of type {} matching"
" ('{}') was emitted. The list of emitted warnings"
" ('{}') were emitted. The list of emitted warnings"
" is: {}.".format(
self.expected_warning,
self.match_expr,

View File

@ -263,7 +263,7 @@ class TestWarns:
with pytest.warns(RuntimeWarning):
warnings.warn("user", UserWarning)
excinfo.match(
r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) was emitted. "
r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) were emitted. "
r"The list of emitted warnings is: \[UserWarning\('user',?\)\]."
)
@ -271,7 +271,7 @@ class TestWarns:
with pytest.warns(UserWarning):
warnings.warn("runtime", RuntimeWarning)
excinfo.match(
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) was emitted. "
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. "
r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)\]."
)
@ -279,7 +279,7 @@ class TestWarns:
with pytest.warns(UserWarning):
pass
excinfo.match(
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) was emitted. "
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. "
r"The list of emitted warnings is: \[\]."
)
@ -290,7 +290,7 @@ class TestWarns:
warnings.warn("import", ImportWarning)
message_template = (
"DID NOT WARN. No warnings of type {0} was emitted. "
"DID NOT WARN. No warnings of type {0} were emitted. "
"The list of emitted warnings is: {1}."
)
excinfo.match(