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_excinfo.py | testing/code/test_excinfo.py | 278 | test_traceback_getcrashentry | def | function | def test_traceback_getcrashentry(self):
def i():
__tracebackhide__ = _True
raise ValueError
def h():
i()
def g():
__tracebackhide__ = _True
h()
def f():
g()
excinfo = pytest.raises(ValueError, f)
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 279 | i | def | function | def i():
__tracebackhide__ = _True
raise ValueError
def h():
i()
def g():
__tracebackhide__ = _True
h()
def f():
g()
excinfo = pytest.raises(ValueError, f)
tb = excinfo.traceback
entry = t... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 283 | 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 | 284 | i | ref | function | i()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 286 | 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 | 288 | h | ref | function | h()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 290 | 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 | 291 | g | ref | function | g()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 293 | raises | ref | function | excinfo = pytest.raises(ValueError, f)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 295 | getcrashentry | ref | function | entry = tb.getcrashentry()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 296 | from_function | ref | function | co = _pytest._code.Code.from_function(h)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 301 | test_traceback_getcrashentry_empty | def | function | def test_traceback_getcrashentry_empty(self):
def g():
__tracebackhide__ = _True
raise ValueError
def f():
__tracebackhide__ = _True
g()
excinfo = pytest.raises(ValueError, f)
tb = excinfo.traceback
entry = tb.getcrashentry()
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 302 | 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 | 306 | 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 | 308 | g | ref | function | g()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 310 | raises | ref | function | excinfo = pytest.raises(ValueError, f)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 312 | getcrashentry | ref | function | entry = tb.getcrashentry()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 313 | from_function | ref | function | co = _pytest._code.Code.from_function(g)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 319 | test_excinfo_exconly | def | function | def test_excinfo_exconly():
excinfo = pytest.raises(ValueError, h)
assert excinfo.exconly().startswith("ValueError")
with pytest.raises(ValueError) as excinfo:
raise ValueError("hello\nworld")
msg = excinfo.exconly(tryshort=_True)
assert msg.startswith("ValueError")
assert msg.endswith("... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 320 | 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 | 321 | exconly | ref | function | assert excinfo.exconly().startswith("ValueError")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 322 | 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 | 324 | exconly | ref | function | msg = excinfo.exconly(tryshort=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 329 | test_excinfo_repr_str | def | function | def test_excinfo_repr_str() -> None:
excinfo1 = pytest.raises(ValueError, h)
assert repr(excinfo1) == "<ExceptionInfo ValueError() tblen=4>"
assert str(excinfo1) == "<ExceptionInfo ValueError() tblen=4>"
class CustomException(Exception):
def __repr__(self):
return "custom_repr"
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 330 | raises | ref | function | excinfo1 = pytest.raises(ValueError, h)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 334 | CustomException | def | class | __repr__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 338 | raises | def | function | def raises() -> None:
raise CustomException()
excinfo2 = pytest.raises(CustomException, raises)
assert repr(excinfo2) == "<ExceptionInfo custom_repr tblen=2>"
assert str(excinfo2) == "<ExceptionInfo custom_repr tblen=2>"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 339 | CustomException | ref | function | raise CustomException()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 341 | raises | ref | function | excinfo2 = pytest.raises(CustomException, raises)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 346 | test_excinfo_for_later | def | function | def test_excinfo_for_later() -> None:
e = ExceptionInfo[BaseException].for_later()
assert "for raises" in repr(e)
assert "for raises" in str(e)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 347 | for_later | ref | function | e = ExceptionInfo[BaseException].for_later()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 352 | test_excinfo_errisinstance | def | function | def test_excinfo_errisinstance():
excinfo = pytest.raises(ValueError, h)
assert excinfo.errisinstance(ValueError)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 353 | 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 | 354 | errisinstance | ref | function | assert excinfo.errisinstance(ValueError)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 357 | test_excinfo_no_sourcecode | def | function | def test_excinfo_no_sourcecode():
try:
exec("raise ValueError()")
except ValueError:
excinfo = _pytest._code.ExceptionInfo.from_current()
s = str(excinfo.traceback[-1])
assert s == " File '<string>':1 in <module>\n ???\n"
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 361 | 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 | 366 | test_excinfo_no_python_sourcecode | def | function | def test_excinfo_no_python_sourcecode(tmp_path: Path) -> None:
# XXX: simplified locally testable version
tmp_path.joinpath("test.txt").write_text("{{ h()}}:")
jinja2 = pytest.importorskip("jinja2")
loader = jinja2.FileSystemLoader(str(tmp_path))
env = jinja2.Environment(loader=loader)
template... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 370 | importorskip | ref | function | jinja2 = pytest.importorskip("jinja2")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 371 | FileSystemLoader | ref | function | loader = jinja2.FileSystemLoader(str(tmp_path))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 372 | Environment | ref | function | env = jinja2.Environment(loader=loader)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 373 | get_template | ref | function | template = env.get_template("test.txt")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 374 | raises | ref | function | excinfo = pytest.raises(ValueError, template.render, h=h)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 382 | test_entrysource_Queue_example | def | function | def test_entrysource_Queue_example():
try:
queue.Queue().get(timeout=0.001)
except queue.Empty:
excinfo = _pytest._code.ExceptionInfo.from_current()
entry = excinfo.traceback[-1]
source = entry.getsource()
assert source is not None
s = str(source).strip()
assert s.startswith(... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 386 | 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 | 388 | getsource | ref | function | source = entry.getsource()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 394 | test_codepath_Queue_example | def | function | def test_codepath_Queue_example() -> None:
try:
queue.Queue().get(timeout=0.001)
except queue.Empty:
excinfo = _pytest._code.ExceptionInfo.from_current()
entry = excinfo.traceback[-1]
path = entry.path
assert isinstance(path, Path)
assert path.name.lower() == "queue.py"
asser... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 398 | 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 | 406 | test_match_succeeds | def | function | def test_match_succeeds():
with pytest.raises(ZeroDivisionError) as excinfo:
0 // 0
excinfo.match(r".*zero.*")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 407 | raises | ref | function | with pytest.raises(ZeroDivisionError) as excinfo:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 412 | test_match_raises_error | def | function | def test_match_raises_error(pytester: Pytester) -> None:
pytester.makepyfile(
"""
import pytest
def test_division_zero():
with pytest.raises(ZeroDivisionError) as excinfo:
0 / 0
excinfo.match(r'[123]+')
"""
)
result = pytester.runpytest()
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 413 | makepyfile | ref | function | pytester.makepyfile(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 422 | runpytest | ref | function | result = pytester.runpytest()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 426 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines([f"E * AssertionError: {exc_msg}"])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 427 | no_fnmatch_line | ref | function | result.stdout.no_fnmatch_line("*__tracebackhide__ = True*")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 429 | runpytest | ref | function | result = pytester.runpytest("--fulltrace")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 431 | fnmatch_lines | ref | function | result.stdout.fnmatch_lines(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 436 | TestFormattedExcinfo | def | class | importasmod test_repr_source test_repr_source_excinfo test_repr_source_not_existing test_repr_many_line_source_not_existing test_repr_source_failing_fullsource test_repr_local test_repr_local_with_error test_repr_local_with_exception_in_class_property test_repr_local_truncated test_repr_tracebackentry_lines test_repr_t... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 438 | importasmod | def | function | def importasmod(self, tmp_path: Path, _sys_snapshot):
def importasmod(source):
source = textwrap.dedent(source)
modpath = tmp_path.joinpath("mod.py")
tmp_path.joinpath("__init__.py").touch()
modpath.write_text(source)
importlib.invalidate_caches()
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 439 | importasmod | def | function | def importasmod(source):
source = textwrap.dedent(source)
modpath = tmp_path.joinpath("mod.py")
tmp_path.joinpath("__init__.py").touch()
modpath.write_text(source)
importlib.invalidate_caches()
return import_path(modpath, root=tmp_path)
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 445 | import_path | ref | function | return import_path(modpath, root=tmp_path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 449 | test_repr_source | def | function | def test_repr_source(self):
pr = FormattedExcinfo()
source = _pytest._code.Source(
"""\
def f(x):
pass
"""
).strip()
pr.flow_marker = "|" # type: ignore[misc]
lines = pr.get_source(source, 0)
assert len(lines) == 2
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 450 | FormattedExcinfo | ref | function | pr = FormattedExcinfo()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 451 | Source | ref | function | source = _pytest._code.Source(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 458 | get_source | ref | function | lines = pr.get_source(source, 0)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 463 | test_repr_source_excinfo | def | function | def test_repr_source_excinfo(self) -> None:
"""Check if indentation is right."""
try:
def f():
1 / 0
f()
except BaseException:
excinfo = _pytest._code.ExceptionInfo.from_current()
else:
assert _False, "did not raise"
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 467 | f | def | function | def f():
1 / 0
f()
except BaseException:
excinfo = _pytest._code.ExceptionInfo.from_current()
else:
assert _False, "did not raise"
pr = FormattedExcinfo()
source = pr._getentrysource(excinfo.traceback[-1])
assert ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 470 | f | ref | function | f()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 473 | 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 | 477 | FormattedExcinfo | ref | function | pr = FormattedExcinfo()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 478 | _getentrysource | ref | function | source = pr._getentrysource(excinfo.traceback[-1])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 480 | get_source | ref | function | lines = pr.get_source(source, 1, excinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 489 | test_repr_source_not_existing | def | function | def test_repr_source_not_existing(self):
pr = FormattedExcinfo()
co = compile("raise ValueError()", "", "exec")
try:
exec(co)
except ValueError:
excinfo = _pytest._code.ExceptionInfo.from_current()
repr = pr.repr_excinfo(excinfo)
assert repr.re... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 490 | FormattedExcinfo | ref | function | pr = FormattedExcinfo()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 495 | 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 | 496 | repr_excinfo | ref | function | repr = pr.repr_excinfo(excinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 500 | test_repr_many_line_source_not_existing | def | function | def test_repr_many_line_source_not_existing(self):
pr = FormattedExcinfo()
co = compile(
"""
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 501 | FormattedExcinfo | ref | function | pr = FormattedExcinfo()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 513 | 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 | 514 | repr_excinfo | ref | function | repr = pr.repr_excinfo(excinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 518 | test_repr_source_failing_fullsource | def | function | def test_repr_source_failing_fullsource(self, monkeypatch) -> None:
pr = FormattedExcinfo()
try:
1 / 0
except ZeroDivisionError:
excinfo = ExceptionInfo.from_current()
with monkeypatch.context() as m:
m.setattr(_pytest._code.Code, "fullsource", p... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 519 | FormattedExcinfo | ref | function | pr = FormattedExcinfo()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 524 | from_current | ref | function | excinfo = ExceptionInfo.from_current()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 526 | context | ref | function | with monkeypatch.context() as m:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 528 | repr_excinfo | ref | function | repr = pr.repr_excinfo(excinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 533 | test_repr_local | def | function | def test_repr_local(self) -> None:
p = FormattedExcinfo(showlocals=_True)
loc = {"y": 5, "z": 7, "x": 3, "@x": 2, "__builtins__": {}}
reprlocals = p.repr_locals(loc)
assert reprlocals is not None
assert reprlocals.lines
assert reprlocals.lines[0] == "__builtins__ = <b... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 534 | FormattedExcinfo | ref | function | p = FormattedExcinfo(showlocals=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 536 | repr_locals | ref | function | reprlocals = p.repr_locals(loc)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 544 | test_repr_local_with_error | def | function | def test_repr_local_with_error(self) -> None:
class ObjWithErrorInRepr:
def __repr__(self):
raise NotImplementedError
p = FormattedExcinfo(showlocals=_True, truncate_locals=_False)
loc = {"x": ObjWithErrorInRepr(), "__builtins__": {}}
reprlocals = p.repr_... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 545 | ObjWithErrorInRepr | def | class | __repr__ __repr__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 549 | FormattedExcinfo | ref | function | p = FormattedExcinfo(showlocals=True, truncate_locals=False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 550 | ObjWithErrorInRepr | ref | function | loc = {"x": ObjWithErrorInRepr(), "__builtins__": {}}
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 551 | repr_locals | ref | function | reprlocals = p.repr_locals(loc)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 557 | test_repr_local_with_exception_in_class_property | def | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 558 | ExceptionWithBrokenClass | def | class | __class__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 564 | ObjWithErrorInRepr | def | class | __repr__ __repr__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 566 | ExceptionWithBrokenClass | ref | function | raise ExceptionWithBrokenClass()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 568 | FormattedExcinfo | ref | function | p = FormattedExcinfo(showlocals=True, truncate_locals=False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 569 | ObjWithErrorInRepr | ref | function | loc = {"x": ObjWithErrorInRepr(), "__builtins__": {}}
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 570 | repr_locals | ref | function | reprlocals = p.repr_locals(loc)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/testing/code/test_excinfo.py | testing/code/test_excinfo.py | 576 | test_repr_local_truncated | def | function | def test_repr_local_truncated(self) -> None:
loc = {"l": [i for i in range(10)]}
p = FormattedExcinfo(showlocals=_True)
truncated_reprlocals = p.repr_locals(loc)
assert truncated_reprlocals is not None
assert truncated_reprlocals.lines
assert truncated_reprlocals.line... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.