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

Function test_show_fixtures_and_execute_test

testing/test_setuponly.py:259–277  ·  view source on GitHub ↗

Verify that setups are shown and tests are executed.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

257
258
259def test_show_fixtures_and_execute_test(pytester: Pytester) -> None:
260 """Verify that setups are shown and tests are executed."""
261 p = pytester.makepyfile(
262 """
263 import pytest
264 @pytest.fixture
265 def arg():
266 assert True
267 def test_arg(arg):
268 assert False
269 """
270 )
271
272 result = pytester.runpytest("--setup-show", p)
273 assert result.ret == 1
274
275 result.stdout.fnmatch_lines(
276 ["*SETUP F arg*", "*test_arg (fixtures used: arg)F*", "*TEARDOWN F arg*"]
277 )
278
279
280def test_setup_show_with_KeyboardInterrupt_in_test(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected