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/scripts/release.py | scripts/release.py | 87 | check_links | ref | function | check_links()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 98 | changelog | def | function | null |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 103 | main | def | function | def main():
init(autoreset=_True)
parser = argparse.ArgumentParser()
parser.add_argument("version", help="Release version")
parser.add_argument(
"template_name", help="Name of template file to use for release announcement"
)
parser.add_argument("--skip-check-links", action="store_true", ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 104 | init | ref | function | init(autoreset=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 106 | add_argument | ref | function | parser.add_argument("version", help="Release version")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 107 | add_argument | ref | function | parser.add_argument(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 110 | add_argument | ref | function | parser.add_argument("--skip-check-links", action="store_true", default=False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 111 | parse_args | ref | function | options = parser.parse_args()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 112 | pre_release | ref | function | pre_release(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/release.py | scripts/release.py | 120 | main | ref | function | main()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/towncrier-draft-to-file.py | scripts/towncrier-draft-to-file.py | 4 | main | def | function | def main():
"""
Platform agnostic wrapper script for towncrier.
Fixes the issue (#7251) where windows users are unable to natively run tox -e docs to build pytest docs.
"""
with open("doc/en/_changelog_towncrier_draft.rst", "w") as draft_file:
return call(("towncrier", "--draft"), stdout=dra... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/towncrier-draft-to-file.py | scripts/towncrier-draft-to-file.py | 14 | main | ref | function | sys.exit(main())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 37 | escape_rst | def | function | def escape_rst(text: str) -> str:
"""Rudimentary attempt to escape special RST characters to appear as
plain text."""
text = (
text.replace("*", "\\*")
.replace("<", "\\<")
.replace(">", "\\>")
.replace("`", "\\`")
)
text = re.sub(r"_\b", "", text)
return text
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 50 | iter_plugins | def | function | def iter_plugins():
regex = r">([\d\w-]*)</a>"
response = requests.get("https://pypi.org/simple")
matches = list(
match
for match in re.finditer(regex, response.text)
if match.groups()[0].startswith("pytest-")
)
for match in tqdm(matches, smoothing=0):
name = match.... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 57 | groups | ref | function | if match.groups()[0].startswith("pytest-")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 61 | groups | ref | function | name = match.groups()[0]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 67 | raise_for_status | ref | function | response.raise_for_status()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 68 | json | ref | function | info = response.json()["info"]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 83 | json | ref | function | releases = response.json()["releases"]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 86 | fromisoformat | ref | function | release_date = datetime.date.fromisoformat(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 89 | strftime | ref | function | last_release = release_date.strftime("%b %d, %Y")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 92 | escape_rst | ref | function | summary = escape_rst(info["summary"].replace("\n", ""))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 102 | plugin_definitions | def | function | def plugin_definitions(plugins):
"""Return RST for the plugin list that fits better on a vertical page."""
for plugin in plugins:
yield dedent(
f"""
{plugin['name']}
*last release*: {plugin["last release"]},
*status*: {plugin["status"]},
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 118 | main | def | function | def main():
plugins = list(iter_plugins())
reference_dir = pathlib.Path("doc", "en", "reference")
plugin_list = reference_dir / "plugin_list.rst"
with plugin_list.open("w") as f:
f.write(FILE_HEAD)
f.write(f"This list contains {len(plugins)} plugins.\n\n")
f.write(".. only:: no... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 119 | iter_plugins | ref | function | plugins = list(iter_plugins())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 135 | plugin_definitions | ref | function | f.write(indent("".join(plugin_definitions(plugins)), " "))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/scripts/update-plugin-list.py | scripts/update-plugin-list.py | 139 | main | ref | function | main()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_argcomplete.py | src/_pytest/_argcomplete.py | 72 | FastFilesCompleter | def | class | __init__ __call__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_argcomplete.py | src/_pytest/_argcomplete.py | 81 | dirname | ref | function | prefix_dir = len(os.path.dirname(prefix) + os.path.sep)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_argcomplete.py | src/_pytest/_argcomplete.py | 93 | isdir | ref | function | if os.path.isdir(x):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_argcomplete.py | src/_pytest/_argcomplete.py | 105 | FastFilesCompleter | ref | function | filescompleter: Optional[FastFilesCompleter] = FastFilesCompleter()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_argcomplete.py | src/_pytest/_argcomplete.py | 107 | try_argcomplete | def | function | def try_argcomplete(parser: argparse.ArgumentParser) -> None:
argcomplete.autocomplete(parser, always_complete_options=_False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_argcomplete.py | src/_pytest/_argcomplete.py | 108 | autocomplete | ref | function | argcomplete.autocomplete(parser, always_complete_options=False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_argcomplete.py | src/_pytest/_argcomplete.py | 113 | try_argcomplete | def | function | def try_argcomplete(parser: argparse.ArgumentParser) -> None:
argcomplete.autocomplete(parser, always_complete_options=_False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 58 | Code | def | class | __init__ from_function __eq__ firstlineno name path fullsource source getargs |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 67 | from_function | def | function | def from_function(cls, obj: object) -> "Code":
return cls(getrawcode(obj))
def __eq__(self, other):
return self.raw == other.raw
# Ignore type because of https://github.com/python/mypy/issues/4266.
__hash__ = None # type: ignore
@property
def firstlineno(self) -> int:
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 68 | cls | ref | function | return cls(getrawcode(obj))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 68 | getrawcode | ref | function | return cls(getrawcode(obj))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 77 | firstlineno | def | function | def firstlineno(self) -> int:
return self.raw.co_firstlineno - 1
@property
def name(self) -> str:
return self.raw.co_name
@property
def path(self) -> Union[Path, str]:
"""Return a path object pointing to source code, or an ``str`` in
case of ``OSError`` / non-existi... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 81 | name | def | function | def name(self) -> str:
return self.raw.co_name
@property
def path(self) -> Union[Path, str]:
"""Return a path object pointing to source code, or an ``str`` in
case of ``OSError`` / non-existing file."""
if not self.raw.co_filename:
return ""
try:
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 85 | path | def | function | def path(self) -> Union[Path, str]:
"""Return a path object pointing to source code, or an ``str`` in
case of ``OSError`` / non-existing file."""
if not self.raw.co_filename:
return ""
try:
p = absolutepath(self.raw.co_filename)
# maybe don't try t... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 91 | absolutepath | ref | function | p = absolutepath(self.raw.co_filename)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 102 | fullsource | def | function | def fullsource(self) -> Optional["Source"]:
"""Return a _pytest._code.Source object for the full source file of the code."""
full, _ = findsource(self.raw)
return full
def source(self) -> "Source":
"""Return a _pytest._code.Source object for the code object's source only."""
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 107 | source | def | function | def source(self) -> "Source":
"""Return a _pytest._code.Source object for the code object's source only."""
# return source only for that part of code
return Source(self.raw)
def getargs(self, var: bool = _False) -> Tuple[str, ...]:
"""Return a tuple with the argument names for ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 110 | Source | ref | function | return Source(self.raw)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 127 | Frame | def | class | __init__ lineno f_globals f_locals code statement eval repr getargs |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 137 | lineno | def | function | def lineno(self) -> int:
return self.raw.f_lineno - 1
@property
def f_globals(self) -> Dict[str, Any]:
return self.raw.f_globals
@property
def f_locals(self) -> Dict[str, Any]:
return self.raw.f_locals
@property
def code(self) -> Code:
return Code(self.raw.... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 141 | f_globals | def | function | def f_globals(self) -> Dict[str, Any]:
return self.raw.f_globals
@property
def f_locals(self) -> Dict[str, Any]:
return self.raw.f_locals
@property
def code(self) -> Code:
return Code(self.raw.f_code)
@property
def statement(self) -> "Source":
"""Statement ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 145 | f_locals | def | function | def f_locals(self) -> Dict[str, Any]:
return self.raw.f_locals
@property
def code(self) -> Code:
return Code(self.raw.f_code)
@property
def statement(self) -> "Source":
"""Statement this frame is at."""
if self.code.fullsource is None:
return Source("")
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 149 | code | def | function | def code(self) -> Code:
return Code(self.raw.f_code)
@property
def statement(self) -> "Source":
"""Statement this frame is at."""
if self.code.fullsource is None:
return Source("")
return self.code.fullsource.getstatement(self.lineno)
def eval(self, code, **... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 150 | Code | ref | function | return Code(self.raw.f_code)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 153 | statement | def | function | def statement(self) -> "Source":
"""Statement this frame is at."""
if self.code.fullsource is None:
return Source("")
return self.code.fullsource.getstatement(self.lineno)
def eval(self, code, **vars):
"""Evaluate 'code' in the frame.
'vars' are optional add... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 156 | Source | ref | function | return Source("")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 157 | getstatement | ref | function | return self.code.fullsource.getstatement(self.lineno)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 172 | saferepr | ref | function | return saferepr(object)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 189 | TracebackEntry | def | class | __init__ lineno set_repr_style frame relline __repr__ statement path locals getfirstlinesource getsource ishidden __str__ name |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 204 | lineno | def | function | def lineno(self) -> int:
return self.raw.f_lineno - 1
@property
def f_globals(self) -> Dict[str, Any]:
return self.raw.f_globals
@property
def f_locals(self) -> Dict[str, Any]:
return self.raw.f_locals
@property
def code(self) -> Code:
return Code(self.raw.... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 207 | set_repr_style | def | function | def set_repr_style(self, mode: "Literal['short', 'long']") -> None:
assert mode in ("short", "long")
self._repr_style = mode
@property
def frame(self) -> Frame:
return Frame(self._rawentry.tb_frame)
@property
def relline(self) -> int:
return self.lineno - self.frame... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 212 | frame | def | function | def frame(self) -> Frame:
return Frame(self._rawentry.tb_frame)
@property
def relline(self) -> int:
return self.lineno - self.frame.code.firstlineno
def __repr__(self) -> str:
return "<TracebackEntry %s:%d>" % (self.frame.code.path, self.lineno + 1)
@property
def state... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 213 | Frame | ref | function | return Frame(self._rawentry.tb_frame)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 216 | relline | def | function | def relline(self) -> int:
return self.lineno - self.frame.code.firstlineno
def __repr__(self) -> str:
return "<TracebackEntry %s:%d>" % (self.frame.code.path, self.lineno + 1)
@property
def statement(self) -> "Source":
"""_pytest._code.Source object for the current statement.""... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 223 | statement | def | function | def statement(self) -> "Source":
"""Statement this frame is at."""
if self.code.fullsource is None:
return Source("")
return self.code.fullsource.getstatement(self.lineno)
def eval(self, code, **vars):
"""Evaluate 'code' in the frame.
'vars' are optional add... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 227 | getstatement | ref | function | return source.getstatement(self.lineno)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 230 | path | def | function | def path(self) -> Union[Path, str]:
"""Return a path object pointing to source code, or an ``str`` in
case of ``OSError`` / non-existing file."""
if not self.raw.co_filename:
return ""
try:
p = absolutepath(self.raw.co_filename)
# maybe don't try t... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 239 | getfirstlinesource | def | function | def getfirstlinesource(self) -> int:
return self.frame.code.firstlineno
def getsource(
self, astcache: Optional[Dict[Union[str, Path], ast.AST]] = None
) -> Optional["Source"]:
"""Return failing source code."""
# we use the passed in astcache to not reparse asttrees
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 256 | getfirstlinesource | ref | function | start = self.getfirstlinesource()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 258 | getstatementrange_ast | ref | function | astnode, _, end = getstatementrange_ast(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 270 | ishidden | def | function | def ishidden(self) -> bool:
"""Return _True if the current frame has a var __tracebackhide__
resolving to _True.
If __tracebackhide__ is a callable, it gets called with the
ExceptionInfo instance and can decide whether to hide the traceback.
Mostly for internal use.
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 294 | tbh | ref | function | return tbh(None if self._excinfo is None else self._excinfo())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 294 | _excinfo | ref | function | return tbh(None if self._excinfo is None else self._excinfo())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 316 | name | def | function | def name(self) -> str:
return self.raw.co_name
@property
def path(self) -> Union[Path, str]:
"""Return a path object pointing to source code, or an ``str`` in
case of ``OSError`` / non-existing file."""
if not self.raw.co_filename:
return ""
try:
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 333 | f | def | function | def f(cur: TracebackType) -> Iterable[TracebackEntry]:
cur_: Optional[TracebackType] = cur
while cur_ is not None:
yield TracebackEntry(cur_, excinfo=excinfo)
cur_ = cur_.tb_next
super().__init__(f(tb))
else:
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 336 | TracebackEntry | ref | function | yield TracebackEntry(cur_, excinfo=excinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 339 | f | ref | function | super().__init__(f(tb))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 343 | cut | def | function | def cut(
self,
path: Optional[Union[Path, str]] = None,
lineno: Optional[int] = None,
firstlineno: Optional[int] = None,
excludepath: Optional[Path] = None,
) -> "Traceback":
"""Return a Traceback instance wrapping part of this Traceback.
By providing any... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 394 | ishidden | ref | function | self, fn: Callable[[TracebackEntry], bool] = lambda x: not x.ishidden()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 407 | getcrashentry | def | function | def getcrashentry(self) -> TracebackEntry:
"""Return last non-hidden traceback entry that lead to the exception of a traceback."""
for i in range(-1, -len(self) - 1, -1):
entry = self[i]
if not entry.ishidden():
return entry
return self[-1]
def re... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 411 | ishidden | ref | function | if not entry.ishidden():
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 415 | recursionindex | def | function | def recursionindex(self) -> Optional[int]:
"""Return the index of the frame/TracebackEntry where recursion originates if
appropriate, None if no recursion occurred."""
cache: Dict[Tuple[Any, int, int], List[Dict[str, Any]]] = {}
for i, entry in enumerate(self):
# id for t... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 442 | ExceptionInfo | def | class | __init__ from_exc_info from_current for_later fill_unfilled type value tb typename traceback traceback __repr__ exconly errisinstance _getreprcrash getrepr match |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 459 | check_ispytest | ref | function | check_ispytest(_ispytest)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 465 | from_exc_info | def | function | def from_exc_info(
cls,
exc_info: Tuple[Type[E], E, TracebackType],
exprinfo: Optional[str] = None,
) -> "ExceptionInfo[E]":
"""Return an ExceptionInfo for an existing exc_info tuple.
.. warning::
Experimental API
:param exprinfo:
A text... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 485 | saferepr | ref | function | exprinfo = saferepr(exc_info[1])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 489 | cls | ref | function | return cls(exc_info, _striptext, _ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 492 | from_current | def | function | def from_current(
cls, exprinfo: Optional[str] = None
) -> "ExceptionInfo[BaseException]":
"""Return an ExceptionInfo matching the current traceback.
.. warning::
Experimental API
:param exprinfo:
A text string helping to determine if we should strip
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 511 | from_exc_info | ref | function | return ExceptionInfo.from_exc_info(exc_info, exprinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 514 | for_later | def | function | def for_later(cls) -> "ExceptionInfo[E]":
"""Return an unfilled ExceptionInfo."""
return cls(None, _ispytest=_True)
def fill_unfilled(self, exc_info: Tuple[Type[E], E, TracebackType]) -> None:
"""Fill an unfilled ExceptionInfo created with ``for_later()``."""
assert self._excinf... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 516 | cls | ref | function | return cls(None, _ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 518 | fill_unfilled | def | function | def fill_unfilled(self, exc_info: Tuple[Type[E], E, TracebackType]) -> None:
"""Fill an unfilled ExceptionInfo created with ``for_later()``."""
assert self._excinfo is None, "ExceptionInfo was already filled"
self._excinfo = exc_info
@property
def type(self) -> Type[E]:
"""T... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 532 | value | def | function | def value(self) -> E:
"""The exception value."""
assert (
self._excinfo is not None
), ".value can only be used after the context manager exits"
return self._excinfo[1]
@property
def tb(self) -> TracebackType:
"""The exception raw traceback."""
as... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 540 | tb | def | function | def tb(self) -> TracebackType:
"""The exception raw traceback."""
assert (
self._excinfo is not None
), ".tb can only be used after the context manager exits"
return self._excinfo[2]
@property
def typename(self) -> str:
"""The type name of the exception."... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 548 | typename | def | function | def typename(self) -> str:
"""The type name of the exception."""
assert (
self._excinfo is not None
), ".typename can only be used after the context manager exits"
return self.type.__name__
@property
def traceback(self) -> Traceback:
"""The traceback."""
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 570 | saferepr | ref | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 573 | exconly | def | function | null |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 589 | errisinstance | def | function | def errisinstance(
self, exc: Union[Type[BaseException], Tuple[Type[BaseException], ...]]
) -> bool:
"""Return _True if the exception is an instance of exc.
Consider using ``isinstance(excinfo.value, exc)`` instead.
"""
return isinstance(self.value, exc)
def _getrep... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 598 | _getreprcrash | def | function | def _getreprcrash(self) -> "ReprFileLocation":
exconly = self.exconly(tryshort=_True)
entry = self.traceback.getcrashentry()
path, lineno = entry.frame.code.raw.co_filename, entry.lineno
return ReprFileLocation(path, lineno + 1, exconly)
def getrepr(
self,
showlo... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 599 | exconly | ref | function | exconly = self.exconly(tryshort=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 600 | getcrashentry | ref | function | entry = self.traceback.getcrashentry()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 602 | ReprFileLocation | ref | function | return ReprFileLocation(path, lineno + 1, exconly)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/_code/code.py | src/_pytest/_code/code.py | 604 | getrepr | def | function | def getrepr(
self,
showlocals: bool = _False,
style: "_TracebackStyle" = "long",
abspath: bool = _False,
tbfilter: bool = _True,
funcargs: bool = _False,
truncate_locals: bool = _True,
chain: bool = _True,
) -> Union["ReprExceptionInfo", "Exception... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.