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

Function test_tbstyle_short

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

Source from the content-addressed store, hash-verified

1322
1323
1324def test_tbstyle_short(pytester: Pytester) -> None:
1325 p = pytester.makepyfile(
1326 """
1327 import pytest
1328
1329 @pytest.fixture
1330 def arg(request):
1331 return 42
1332 def test_opt(arg):
1333 x = 0
1334 assert x
1335 """
1336 )
1337 result = pytester.runpytest("--tb=short")
1338 s = result.stdout.str()
1339 assert "arg = 42" not in s
1340 assert "x = 0" not in s
1341 result.stdout.fnmatch_lines(["*%s:8*" % p.name, " assert x", "E assert*"])
1342 result = pytester.runpytest()
1343 s = result.stdout.str()
1344 assert "x = 0" in s
1345 assert "assert x" in s
1346
1347
1348def 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