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

Method test_capsyscapfd

testing/test_capture.py:445–463  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

443 reprec.assertoutcome(passed=1)
444
445 def test_capsyscapfd(self, pytester: Pytester) -> None:
446 p = pytester.makepyfile(
447 """\
448 def test_one(capsys, capfd):
449 pass
450 def test_two(capfd, capsys):
451 pass
452 """
453 )
454 result = pytester.runpytest(p)
455 result.stdout.fnmatch_lines(
456 [
457 "*ERROR*setup*test_one*",
458 "E*capfd*capsys*same*time*",
459 "*ERROR*setup*test_two*",
460 "E*capsys*capfd*same*time*",
461 "*2 errors*",
462 ]
463 )
464
465 def test_capturing_getfixturevalue(self, pytester: Pytester) -> None:
466 """Test that asking for "capfd" and "capsys" using request.getfixturevalue

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected