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

Function test_tbstyle_short

testing/test_terminal.py:1481–1502  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1479
1480
1481def test_tbstyle_short(pytester: Pytester) -> None:
1482 p = pytester.makepyfile(
1483 """
1484 import pytest
1485
1486 @pytest.fixture
1487 def arg(request):
1488 return 42
1489 def test_opt(arg):
1490 x = 0
1491 assert x
1492 """
1493 )
1494 result = pytester.runpytest("--tb=short")
1495 s = result.stdout.str()
1496 assert "arg = 42" not in s
1497 assert "x = 0" not in s
1498 result.stdout.fnmatch_lines([f"*{p.name}:8*", " assert x", "E assert*"])
1499 result = pytester.runpytest()
1500 s = result.stdout.str()
1501 assert "x = 0" in s
1502 assert "assert x" in s
1503
1504
1505def test_traceconfig(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

strMethod · 0.80
fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected