Skip to content

Commit 5b4435b

Browse files
committed
recwarn: fix was -> were in DID NOT WARN message
1 parent 60ca837 commit 5b4435b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/_pytest/recwarn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def __exit__(
274274
if not any(issubclass(r.category, self.expected_warning) for r in self):
275275
__tracebackhide__ = True
276276
fail(
277-
"DID NOT WARN. No warnings of type {} was emitted. "
277+
"DID NOT WARN. No warnings of type {} were emitted. "
278278
"The list of emitted warnings is: {}.".format(
279279
self.expected_warning, [each.message for each in self]
280280
)
@@ -287,7 +287,7 @@ def __exit__(
287287
else:
288288
fail(
289289
"DID NOT WARN. No warnings of type {} matching"
290-
" ('{}') was emitted. The list of emitted warnings"
290+
" ('{}') were emitted. The list of emitted warnings"
291291
" is: {}.".format(
292292
self.expected_warning,
293293
self.match_expr,

testing/test_recwarn.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,23 +263,23 @@ def test_as_contextmanager(self) -> None:
263263
with pytest.warns(RuntimeWarning):
264264
warnings.warn("user", UserWarning)
265265
excinfo.match(
266-
r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) was emitted. "
266+
r"DID NOT WARN. No warnings of type \(.+RuntimeWarning.+,\) were emitted. "
267267
r"The list of emitted warnings is: \[UserWarning\('user',?\)\]."
268268
)
269269

270270
with pytest.raises(pytest.fail.Exception) as excinfo:
271271
with pytest.warns(UserWarning):
272272
warnings.warn("runtime", RuntimeWarning)
273273
excinfo.match(
274-
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) was emitted. "
274+
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. "
275275
r"The list of emitted warnings is: \[RuntimeWarning\('runtime',?\)\]."
276276
)
277277

278278
with pytest.raises(pytest.fail.Exception) as excinfo:
279279
with pytest.warns(UserWarning):
280280
pass
281281
excinfo.match(
282-
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) was emitted. "
282+
r"DID NOT WARN. No warnings of type \(.+UserWarning.+,\) were emitted. "
283283
r"The list of emitted warnings is: \[\]."
284284
)
285285

@@ -290,7 +290,7 @@ def test_as_contextmanager(self) -> None:
290290
warnings.warn("import", ImportWarning)
291291

292292
message_template = (
293-
"DID NOT WARN. No warnings of type {0} was emitted. "
293+
"DID NOT WARN. No warnings of type {0} were emitted. "
294294
"The list of emitted warnings is: {1}."
295295
)
296296
excinfo.match(

0 commit comments

Comments
 (0)