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

Method test_traceback_argsetup

testing/python/collect.py:1010–1033  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

1008 assert not excinfo.traceback[-2].ishidden()
1009
1010 def test_traceback_argsetup(self, pytester: Pytester) -> None:
1011 pytester.makeconftest(
1012 """
1013 import pytest
1014
1015 @pytest.fixture
1016 def hello(request):
1017 raise ValueError("xyz")
1018 """
1019 )
1020 p = pytester.makepyfile("def test(hello): pass")
1021 result = pytester.runpytest(p)
1022 assert result.ret != 0
1023 out = result.stdout.str()
1024 assert "xyz" in out
1025 assert "conftest.py:5: ValueError" in out
1026 numentries = out.count("_ _ _") # separator for traceback entries
1027 assert numentries == 0
1028
1029 result = pytester.runpytest("--fulltrace", p)
1030 out = result.stdout.str()
1031 assert "conftest.py:5: ValueError" in out
1032 numentries = out.count("_ _ _ _") # separator for traceback entries
1033 assert numentries > 3
1034
1035 def test_traceback_error_during_import(self, pytester: Pytester) -> None:
1036 pytester.makepyfile(

Callers

nothing calls this directly

Calls 5

strMethod · 0.80
countMethod · 0.80
makeconftestMethod · 0.45
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected