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

Function test_excinfo_no_sourcecode

testing/code/test_excinfo.py:385–394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383
384
385def test_excinfo_no_sourcecode():
386 try:
387 exec("raise ValueError()")
388 except ValueError:
389 excinfo = _pytest._code.ExceptionInfo.from_current()
390 s = str(excinfo.traceback[-1])
391 # TODO: Since Python 3.13b1 under pytest-xdist, the * is `import
392 # sys;exec(eval(sys.stdin.readline()))` (execnet bootstrap code)
393 # instead of `???` like before. Is this OK?
394 fnmatch.fnmatch(s, " File '<string>':1 in <module>\n *\n")
395
396
397def test_excinfo_no_python_sourcecode(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 2

from_currentMethod · 0.80
fnmatchMethod · 0.45

Tested by

no test coverage detected