MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_tuple_warning

Method test_tuple_warning

testing/test_warnings.py:561–571  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

559 result.stdout.fnmatch_lines(["*PytestAssertRewriteWarning: %s*" % msg])
560
561 def test_tuple_warning(self, pytester: Pytester) -> None:
562 pytester.makepyfile(
563 """\
564 def test_foo():
565 assert (1,2)
566 """
567 )
568 result = pytester.runpytest()
569 self.assert_result_warns(
570 result, "assertion is always true, perhaps remove parentheses?"
571 )
572
573
574def test_warnings_checker_twice() -> None:

Callers

nothing calls this directly

Calls 3

assert_result_warnsMethod · 0.95
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected