fname
stringlengths
63
176
rel_fname
stringclasses
706 values
line
int64
-1
4.5k
name
stringlengths
1
81
kind
stringclasses
2 values
category
stringclasses
2 values
info
stringlengths
0
77.9k
⌀
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
143
TestExceptionInfo
def
class
test_bad_getsource test_from_current_with_missing
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
144
test_bad_getsource
def
function
def test_bad_getsource(self) -> None: try: if _False: pass else: assert _False except AssertionError: exci = ExceptionInfo.from_current() assert exci.getrepr() def test_from_current_with_missing(self) -> None: w...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
151
from_current
ref
function
exci = ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
152
getrepr
ref
function
assert exci.getrepr()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
154
test_from_current_with_missing
def
function
def test_from_current_with_missing(self) -> None: with pytest.raises(AssertionError, match="no current exception"): ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
155
raises
ref
function
with pytest.raises(AssertionError, match="no current exception"):
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
156
from_current
ref
function
ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
159
TestTracebackEntry
def
class
test_getsource test_tb_entry_str
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
160
test_getsource
def
function
def test_getsource(self) -> None: try: if _False: pass else: assert _False except AssertionError: exci = ExceptionInfo.from_current() entry = exci.traceback[0] source = entry.getsource() assert source is not ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
167
from_current
ref
function
exci = ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
169
getsource
ref
function
source = entry.getsource()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
174
test_tb_entry_str
def
function
def test_tb_entry_str(self): try: assert _False except AssertionError: exci = ExceptionInfo.from_current() pattern = r" File '.*test_code.py':\d+ in test_tb_entry_str\n assert _False" entry = str(exci.traceback[0]) assert re.match(pattern, entry)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
178
from_current
ref
function
exci = ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
184
TestReprFuncArgs
def
class
test_not_raise_exception_with_mixed_encoding
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
185
test_not_raise_exception_with_mixed_encoding
def
function
def test_not_raise_exception_with_mixed_encoding(self, tw_mock) -> None: args = [("unicode_string", "São Paulo"), ("utf8_string", b"S\xc3\xa3o Paulo")] r = ReprFuncArgs(args) r.toterminal(tw_mock) assert ( tw_mock.lines[0] == r"unicode_string = São Paulo, ut...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
188
ReprFuncArgs
ref
function
r = ReprFuncArgs(args)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
189
toterminal
ref
function
r.toterminal(tw_mock)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
197
test_ExceptionChainRepr
def
function
def test_ExceptionChainRepr(): """Test ExceptionChainRepr, especially with regard to being hashable.""" try: raise ValueError() except ValueError: excinfo1 = ExceptionInfo.from_current() excinfo2 = ExceptionInfo.from_current() repr1 = excinfo1.getrepr() repr2 = excinfo2.getr...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
202
from_current
ref
function
excinfo1 = ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
203
from_current
ref
function
excinfo2 = ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
205
getrepr
ref
function
repr1 = excinfo1.getrepr()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
206
getrepr
ref
function
repr2 = excinfo2.getrepr()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_code.py
testing/code/test_code.py
211
getrepr
ref
function
assert repr1 is not excinfo1.getrepr()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
31
limited_recursion_depth
def
function
def limited_recursion_depth(): before = sys.getrecursionlimit() sys.setrecursionlimit(150) yield sys.setrecursionlimit(before)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
38
test_excinfo_simple
def
function
def test_excinfo_simple() -> None: try: raise ValueError except ValueError: info = _pytest._code.ExceptionInfo.from_current() assert info.type == ValueError
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
42
from_current
ref
function
info = _pytest._code.ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
46
test_excinfo_from_exc_info_simple
def
function
def test_excinfo_from_exc_info_simple() -> None: try: raise ValueError except ValueError as e: assert e.__traceback__ is not None info = _pytest._code.ExceptionInfo.from_exc_info((type(e), e, e.__traceback__)) assert info.type == ValueError
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
51
from_exc_info
ref
function
info = _pytest._code.ExceptionInfo.from_exc_info((type(e), e, e.__traceback__))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
55
test_excinfo_getstatement
def
function
def test_excinfo_getstatement(): def g(): raise ValueError def f(): g() try: f() except ValueError: excinfo = _pytest._code.ExceptionInfo.from_current() linenumbers = [ f.__code__.co_firstlineno - 1 + 4, f.__code__.co_firstlineno - 1 + 1, g._...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
56
g
def
function
def g(): raise ValueError def f(): g() try: f() except ValueError: excinfo = _pytest._code.ExceptionInfo.from_current() linenumbers = [ f.__code__.co_firstlineno - 1 + 4, f.__code__.co_firstlineno - 1 + 1, g.__code__.co_firstlineno - 1 + 1, ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
59
f
def
function
def f(): g() try: f() except ValueError: excinfo = _pytest._code.ExceptionInfo.from_current() linenumbers = [ f.__code__.co_firstlineno - 1 + 4, f.__code__.co_firstlineno - 1 + 1, g.__code__.co_firstlineno - 1 + 1, ] values = list(excinfo.tracebac...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
60
g
ref
function
g()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
63
f
ref
function
f()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
65
from_current
ref
function
excinfo = _pytest._code.ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
82
f
def
function
def f(): g() try: f() except ValueError: excinfo = _pytest._code.ExceptionInfo.from_current() linenumbers = [ f.__code__.co_firstlineno - 1 + 4, f.__code__.co_firstlineno - 1 + 1, g.__code__.co_firstlineno - 1 + 1, ] values = list(excinfo.traceback) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
88
g
def
function
def g(): raise ValueError def f(): g() try: f() except ValueError: excinfo = _pytest._code.ExceptionInfo.from_current() linenumbers = [ f.__code__.co_firstlineno - 1 + 4, f.__code__.co_firstlineno - 1 + 1, g.__code__.co_firstlineno - 1 + 1, ]...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
91
f
ref
function
f()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
95
h
def
function
def h(): # g() #
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
97
g
ref
function
g()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
101
TestTraceback_f_g_h
def
class
setup_method test_traceback_entries test_traceback_entry_getsource test_traceback_entry_getsource_in_construct test_traceback_cut test_traceback_cut_excludepath test_traceback_filter test_traceback_filter_selective test_traceback_recursion_index test_traceback_only_specific_recursion_errors test_traceback_no_recursion_...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
102
setup_method
def
function
def setup_method(self, method): try: h() except ValueError: self.excinfo = _pytest._code.ExceptionInfo.from_current() def test_traceback_entries(self): tb = self.excinfo.traceback entries = list(tb) assert len(tb) == 4 # maybe fragile test ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
104
h
ref
function
h()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
106
from_current
ref
function
self.excinfo = _pytest._code.ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
108
test_traceback_entries
def
function
def test_traceback_entries(self): tb = self.excinfo.traceback entries = list(tb) assert len(tb) == 4 # maybe fragile test assert len(entries) == 4 # maybe fragile test names = ["f", "g", "h"] for entry in entries: try: names.remove(entry....
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
121
test_traceback_entry_getsource
def
function
def test_traceback_entry_getsource(self): tb = self.excinfo.traceback s = str(tb[-1].getsource()) assert s.startswith("def f():") assert s.endswith("raise ValueError") def test_traceback_entry_getsource_in_construct(self): def xyz(): try: rais...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
123
getsource
ref
function
s = str(tb[-1].getsource())
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
127
test_traceback_entry_getsource_in_construct
def
function
def test_traceback_entry_getsource_in_construct(self): def xyz(): try: raise ValueError except somenoname: # type: ignore[name-defined] # noqa: F821 pass # pragma: no cover try: xyz() except NameError: excinfo...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
128
xyz
def
function
def xyz(): try: raise ValueError except somenoname: # type: ignore[name-defined] # noqa: F821 pass # pragma: no cover try: xyz() except NameError: excinfo = _pytest._code.ExceptionInfo.from_current() else:...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
135
xyz
ref
function
xyz()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
137
from_current
ref
function
excinfo = _pytest._code.ExceptionInfo.from_current()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
142
getsource
ref
function
source = tb[-1].getsource()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
144
deindent
ref
function
assert source.deindent().lines == [
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
151
test_traceback_cut
def
function
def test_traceback_cut(self) -> None: co = _pytest._code.Code.from_function(f) path, firstlineno = co.path, co.firstlineno assert isinstance(path, Path) traceback = self.excinfo.traceback newtraceback = traceback.cut(path=path, firstlineno=firstlineno) assert len(newt...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
152
from_function
ref
function
co = _pytest._code.Code.from_function(f)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
156
cut
ref
function
newtraceback = traceback.cut(path=path, firstlineno=firstlineno)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
158
cut
ref
function
newtraceback = traceback.cut(path=path, lineno=firstlineno + 2)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
161
test_traceback_cut_excludepath
def
function
def test_traceback_cut_excludepath(self, pytester: Pytester) -> None: p = pytester.makepyfile("def f(): raise ValueError") with pytest.raises(ValueError) as excinfo: import_path(p, root=pytester.path).f() # type: ignore[attr-defined] basedir = Path(pytest.__file__).parent ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
162
makepyfile
ref
function
p = pytester.makepyfile("def f(): raise ValueError")
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
163
raises
ref
function
with pytest.raises(ValueError) as excinfo:
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
164
import_path
ref
function
import_path(p, root=pytester.path).f() # type: ignore[attr-defined]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
164
f
ref
function
import_path(p, root=pytester.path).f() # type: ignore[attr-defined]
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
166
cut
ref
function
newtraceback = excinfo.traceback.cut(excludepath=basedir)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
172
test_traceback_filter
def
function
def test_traceback_filter(self): traceback = self.excinfo.traceback ntraceback = traceback.filter() assert len(ntraceback) == len(traceback) - 1 @pytest.mark.parametrize( "tracebackhide, matching", [ (lambda info: _True, _True), (lambda info: _Fal...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
177
parametrize
ref
function
@pytest.mark.parametrize(
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
186
test_traceback_filter_selective
def
function
def test_traceback_filter_selective(self, tracebackhide, matching): def f(): # raise ValueError # def g(): # __tracebackhide__ = tracebackhide f() # def h(): # g() # ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
187
f
def
function
def f(): # raise ValueError # def g(): # __tracebackhide__ = tracebackhide f() # def h(): # g() # excinfo = pytest.raises(ValueError, h) traceback = excinfo....
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
192
g
def
function
def g(): # __tracebackhide__ = tracebackhide f() # def h(): # g() # excinfo = pytest.raises(ValueError, h) traceback = excinfo.traceback ntraceback = traceback.filter() print(f"old: {tra...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
195
f
ref
function
f()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
198
h
def
function
def h(): # g() # excinfo = pytest.raises(ValueError, h) traceback = excinfo.traceback ntraceback = traceback.filter() print(f"old: {traceback!r}") print(f"new: {ntraceback!r}") if matching: assert len(ntraceback) =...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
200
g
ref
function
g()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
203
raises
ref
function
excinfo = pytest.raises(ValueError, h)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
215
test_traceback_recursion_index
def
function
def test_traceback_recursion_index(self): def f(n): if n < 10: n += 1 f(n) excinfo = pytest.raises(RuntimeError, f, 8) traceback = excinfo.traceback recindex = traceback.recursionindex() assert recindex == 3 def test_traceback_onl...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
216
f
def
function
def f(n): if n < 10: n += 1 f(n) excinfo = pytest.raises(RuntimeError, f, 8) traceback = excinfo.traceback recindex = traceback.recursionindex() assert recindex == 3 def test_traceback_only_specific_recursion_errors(self, monkeypatch)...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
219
f
ref
function
f(n)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
221
raises
ref
function
excinfo = pytest.raises(RuntimeError, f, 8)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
223
recursionindex
ref
function
recindex = traceback.recursionindex()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
226
test_traceback_only_specific_recursion_errors
def
function
def test_traceback_only_specific_recursion_errors(self, monkeypatch): def f(n): if n == 0: raise RuntimeError("hello") f(n - 1) excinfo = pytest.raises(RuntimeError, f, 25) monkeypatch.delattr(excinfo.traceback.__class__, "recursionindex") rep...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
227
f
def
function
def f(n): if n < 10: n += 1 f(n) excinfo = pytest.raises(RuntimeError, f, 8) traceback = excinfo.traceback recindex = traceback.recursionindex() assert recindex == 3 def test_traceback_only_specific_recursion_errors(self, monkeypatch)...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
230
f
ref
function
f(n - 1)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
232
raises
ref
function
excinfo = pytest.raises(RuntimeError, f, 25)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
234
getrepr
ref
function
repr = excinfo.getrepr()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
237
test_traceback_no_recursion_index
def
function
def test_traceback_no_recursion_index(self) -> None: def do_stuff() -> None: raise RuntimeError def reraise_me() -> None: import sys exc, val, tb = sys.exc_info() assert val is not None raise val.with_traceback(tb) def f(n: int) ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
238
do_stuff
def
function
def do_stuff() -> None: raise RuntimeError def reraise_me() -> None: import sys exc, val, tb = sys.exc_info() assert val is not None raise val.with_traceback(tb) def f(n: int) -> None: try: do_stuff() ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
241
reraise_me
def
function
def reraise_me() -> None: import sys exc, val, tb = sys.exc_info() assert val is not None raise val.with_traceback(tb) def f(n: int) -> None: try: do_stuff() except BaseException: reraise_me() ...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
246
with_traceback
ref
function
raise val.with_traceback(tb)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
248
f
def
function
def f(n: int) -> None: try: do_stuff() except BaseException: reraise_me() excinfo = pytest.raises(RuntimeError, f, 8) assert excinfo is not None traceback = excinfo.traceback recindex = traceback.recursionindex() as...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
250
do_stuff
ref
function
do_stuff()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
252
reraise_me
ref
function
reraise_me()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
254
raises
ref
function
excinfo = pytest.raises(RuntimeError, f, 8)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
257
recursionindex
ref
function
recindex = traceback.recursionindex()
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
260
test_traceback_messy_recursion
def
function
def test_traceback_messy_recursion(self): # XXX: simplified locally testable version decorator = pytest.importorskip("decorator").decorator def log(f, *k, **kw): print(f"{k} {kw}") f(*k, **kw) log = decorator(log) def fail(): raise Value...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
262
importorskip
ref
function
decorator = pytest.importorskip("decorator").decorator
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
264
log
def
function
def log(f, *k, **kw): print(f"{k} {kw}") f(*k, **kw) log = decorator(log) def fail(): raise ValueError("") fail = log(log(fail)) excinfo = pytest.raises(ValueError, fail) assert excinfo.traceback.recursionindex() is None def te...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
266
f
ref
function
f(*k, **kw)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
268
decorator
ref
function
log = decorator(log)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
270
fail
def
function
def fail(): raise ValueError("") fail = log(log(fail)) excinfo = pytest.raises(ValueError, fail) assert excinfo.traceback.recursionindex() is None def test_traceback_getcrashentry(self): def i(): __tracebackhide__ = _True raise ValueErro...
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
273
log
ref
function
fail = log(log(fail))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
273
log
ref
function
fail = log(log(fail))
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
275
raises
ref
function
excinfo = pytest.raises(ValueError, fail)
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py
testing/code/test_excinfo.py
276
recursionindex
ref
function
assert excinfo.traceback.recursionindex() is None