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

Method test_setup_fixture_error

testing/test_terminal.py:574–594  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

572
573class TestFixtureReporting:
574 def test_setup_fixture_error(self, pytester: Pytester) -> None:
575 pytester.makepyfile(
576 """
577 def setup_function(function):
578 print("setup func")
579 assert 0
580 def test_nada():
581 pass
582 """
583 )
584 result = pytester.runpytest()
585 result.stdout.fnmatch_lines(
586 [
587 "*ERROR at setup of test_nada*",
588 "*setup_function(function):*",
589 "*setup func*",
590 "*assert 0*",
591 "*1 error*",
592 ]
593 )
594 assert result.ret != 0
595
596 def test_teardown_fixture_error(self, pytester: Pytester) -> None:
597 pytester.makepyfile(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected