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

Method test_capture_scope_cache

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

Source from the content-addressed store, hash-verified

176
177 @pytest.mark.xfail(reason="unimplemented feature")
178 def test_capture_scope_cache(self, pytester: Pytester) -> None:
179 p = pytester.makepyfile(
180 """
181 import sys
182 def setup_module(func):
183 print("module-setup")
184 def setup_function(func):
185 print("function-setup")
186 def test_func():
187 print("in function")
188 assert 0
189 def teardown_function(func):
190 print("in teardown")
191 """
192 )
193 result = pytester.runpytest(p)
194 result.stdout.fnmatch_lines(
195 [
196 "*test_func():*",
197 "*Captured stdout during setup*",
198 "module-setup*",
199 "function-setup*",
200 "*Captured stdout*",
201 "in teardown*",
202 ]
203 )
204
205 def test_no_carry_over(self, pytester: Pytester) -> None:
206 p = 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