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

Function test_pytest_fail_notrace_collection

testing/test_runner.py:633–645  ·  view source on GitHub ↗

Test pytest.fail(..., pytrace=False) does not show tracebacks during collection.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

631
632
633def test_pytest_fail_notrace_collection(pytester: Pytester) -> None:
634 """Test pytest.fail(..., pytrace=False) does not show tracebacks during collection."""
635 pytester.makepyfile(
636 """
637 import pytest
638 def some_internal_function():
639 pytest.fail("hello", pytrace=False)
640 some_internal_function()
641 """
642 )
643 result = pytester.runpytest()
644 result.stdout.fnmatch_lines(["hello"])
645 result.stdout.no_fnmatch_line("*def some_internal_function()*")
646
647
648def test_pytest_fail_notrace_non_ascii(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected