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

Function test_collect_capturing

testing/test_capture.py:129–147  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

127
128
129def test_collect_capturing(pytester: Pytester) -> None:
130 p = pytester.makepyfile(
131 """
132 import sys
133
134 print("collect %s failure" % 13)
135 sys.stderr.write("collect %s_stderr failure" % 13)
136 import xyz42123
137 """
138 )
139 result = pytester.runpytest(p)
140 result.stdout.fnmatch_lines(
141 [
142 "*Captured stdout*",
143 "collect 13 failure",
144 "*Captured stderr*",
145 "collect 13_stderr failure",
146 ]
147 )
148
149
150class TestPerTestCapturing:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected