def test_pytest_fail_notrace_runtest(pytester: Pytester) -> None:
    """Test pytest.fail(..., pytrace=False) does not show tracebacks during test run."""
    pytester.makepyfile(
        """
        import pytest
        def test_hello():
            pytest.fail("hello", pytrace=False)
        def teardown_function(function):
            pytest.fail("world", pytrace=False)
    """
    )
    result = pytester.runpytest()
    result.stdout.fnmatch_lines(["world", "hello"])
    result.stdout.no_fnmatch_line("*def teardown_function*")
Test pytest.fail(..., pytrace=False) does not show tracebacks during test run.
testing/test_runner.py