MCPcopy
hub / github.com/pytest-dev/pytest / test_full_output_vvv

Function test_full_output_vvv

testing/test_assertion.py:2462–2492  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

2460
2461
2462def test_full_output_vvv(pytester: Pytester) -> None:
2463 pytester.makepyfile(
2464 r"""
2465 def crash_helper(m):
2466 assert 1 == 2
2467 def test_vvv():
2468 crash_helper(500 * "a")
2469 """
2470 )
2471 result = pytester.runpytest("")
2472 # without -vvv, the passed args are truncated
2473 expected_non_vvv_arg_line = "m = 'aaaaaaaaaaaaaaa*..aaaaaaaaaaaa*"
2474 result.stdout.fnmatch_lines(
2475 [
2476 expected_non_vvv_arg_line,
2477 "test_full_output_vvv.py:2: AssertionError",
2478 ],
2479 )
2480 # double check that the untruncated part is not in the output
2481 expected_vvv_arg_line = "m = '{}'".format(500 * "a")
2482 result.stdout.no_fnmatch_line(expected_vvv_arg_line)
2483
2484 # but with "-vvv" the args are not truncated
2485 result = pytester.runpytest("-vvv")
2486 result.stdout.fnmatch_lines(
2487 [
2488 expected_vvv_arg_line,
2489 "test_full_output_vvv.py:2: AssertionError",
2490 ]
2491 )
2492 result.stdout.no_fnmatch_line(expected_non_vvv_arg_line)
2493
2494
2495def test_dict_extra_items_preserve_insertion_order(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 5

fnmatch_linesMethod · 0.80
no_fnmatch_lineMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected