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

Function test_setup_failure_is_shown

testing/test_unittest.py:261–277  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

259
260
261def test_setup_failure_is_shown(pytester: Pytester) -> None:
262 pytester.makepyfile(
263 """
264 import unittest
265 import pytest
266 class TC(unittest.TestCase):
267 def setUp(self):
268 assert 0, "down1"
269 def test_method(self):
270 print("never42")
271 xyz
272 """
273 )
274 result = pytester.runpytest("-s")
275 assert result.ret == 1
276 result.stdout.fnmatch_lines(["*setUp*", "*assert 0*down1*", "*1 failed*"])
277 result.stdout.no_fnmatch_line("*never42*")
278
279
280def test_setup_setUpClass(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
no_fnmatch_lineMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected