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/src/_pytest/python.py | src/_pytest/python.py | 1,713 | _prunetraceback | def | function | def _prunetraceback(self, excinfo: ExceptionInfo[BaseException]) -> None:
if hasattr(self, "_obj") and not self.config.getoption("fulltrace", _False):
code = _pytest._code.Code.from_function(get_real_func(self.obj))
path, firstlineno = code.path, code.firstlineno
tracebac... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,714 | getoption | ref | function | if hasattr(self, "_obj") and not self.config.getoption("fulltrace", False):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,715 | from_function | ref | function | code = _pytest._code.Code.from_function(get_real_func(self.obj))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,715 | get_real_func | ref | function | code = _pytest._code.Code.from_function(get_real_func(self.obj))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,718 | cut | ref | function | ntraceback = traceback.cut(path=path, firstlineno=firstlineno)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,720 | cut | ref | function | ntraceback = ntraceback.cut(path=path)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,729 | getoption | ref | function | if self.config.getoption("tbstyle", "auto") == "auto":
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,732 | set_repr_style | ref | function | entry.set_repr_style("short")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,735 | repr_failure | def | function | def repr_failure( # type: ignore[override]
self,
excinfo: ExceptionInfo[BaseException],
) -> Union[str, TerminalRepr]:
style = self.config.getoption("tbstyle", "auto")
if style == "auto":
style = "long"
return self._repr_failure_py(excinfo, style=style)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,739 | getoption | ref | function | style = self.config.getoption("tbstyle", "auto")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,742 | _repr_failure_py | ref | function | return self._repr_failure_py(excinfo, style=style)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,745 | FunctionDefinition | def | class | runtest |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python.py | src/_pytest/python.py | 1,751 | runtest | def | function | def runtest(self) -> None:
"""Execute the underlying test function."""
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
def setup(self) -> None:
self._request._fillfixtures()
def _prunetraceback(self, excinfo: ExceptionInfo[BaseException]) -> None:
if hasattr(self, "_obj") an... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 33 | _non_numeric_type_error | def | function | def _non_numeric_type_error(value, at: Optional[str]) -> TypeError:
at_str = f" at {at}" if at else ""
return TypeError(
"cannot make approximate comparisons to non-numeric values: {!r} {}".format(
value, at_str
)
)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 42 | _compare_approx | def | function | def _compare_approx(
full_object: object,
message_data: Sequence[Tuple[str, str, str]],
number_of_elements: int,
different_ids: Sequence[object],
max_abs_diff: float,
max_rel_diff: float,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 71 | ApproxBase | def | class | __init__ __repr__ _repr_compare __eq__ __bool__ __ne__ _approx_scalar _yield_comparisons _check_type |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 85 | _check_type | ref | function | self._check_type()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 90 | _repr_compare | def | function | def _repr_compare(self, other_side: Any) -> List[str]:
return [
"comparison failed",
f"Obtained: {other_side}",
f"Expected: {self}",
]
def __eq__(self, actual) -> bool:
return all(
a == self._approx_scalar(x) for a, x in self._yield_compar... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 99 | _approx_scalar | ref | function | a == self._approx_scalar(x) for a, x in self._yield_comparisons(actual)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 99 | _yield_comparisons | ref | function | a == self._approx_scalar(x) for a, x in self._yield_comparisons(actual)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 113 | _approx_scalar | def | function | def _approx_scalar(self, x) -> "ApproxScalar":
if isinstance(x, Decimal):
return ApproxDecimal(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok)
return ApproxScalar(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok)
def _yield_comparisons(self, actual):
"""Yield all the pai... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 115 | ApproxDecimal | ref | function | return ApproxDecimal(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 116 | ApproxScalar | ref | function | return ApproxScalar(x, rel=self.rel, abs=self.abs, nan_ok=self.nan_ok)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 118 | _yield_comparisons | def | function | def _yield_comparisons(self, actual):
"""Yield all the pairs of numbers to be compared.
This is used to implement the `__eq__` method.
"""
raise NotImplementedError
def _check_type(self) -> None:
"""Raise a TypeError if the expected value is not a valid type."""
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 125 | _check_type | def | function | def _check_type(self) -> None:
"""Raise a TypeError if the expected value is not a valid type."""
# This is only a concern if the expected value is a sequence. In every
# other case, the approx() function ensures that the expected value has
# a numeric type. For this reason, the de... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 135 | _recursive_list_map | def | function | def _recursive_list_map(f, x):
if isinstance(x, list):
return [_recursive_list_map(f, xi) for xi in x]
else:
return f(x)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 137 | _recursive_list_map | ref | function | return [_recursive_list_map(f, xi) for xi in x]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 139 | f | ref | function | return f(x)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 142 | ApproxNumpy | def | class | __repr__ _repr_compare __eq__ _yield_comparisons |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 146 | _recursive_list_map | ref | function | list_scalars = _recursive_list_map(self._approx_scalar, self.expected.tolist())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 149 | _repr_compare | def | function | def _repr_compare(self, other_side: "ndarray") -> List[str]:
import itertools
import math
def get_value_from_nested_list(
nested_list: List[Any], nd_index: Tuple[Any, ...]
) -> Any:
"""
Helper function to get the value out of a nested list, given ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 153 | get_value_from_nested_list | def | function | def get_value_from_nested_list(
nested_list: List[Any], nd_index: Tuple[Any, ...]
) -> Any:
"""
Helper function to get the value out of a nested list, given an n-dimensional index.
This mimics numpy's indexing, but for raw nested python lists.
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 166 | _recursive_list_map | ref | function | approx_side_as_list = _recursive_list_map(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 181 | get_value_from_nested_list | ref | function | approx_value = get_value_from_nested_list(approx_side_as_list, index)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 182 | get_value_from_nested_list | ref | function | other_value = get_value_from_nested_list(other_side, index)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 195 | get_value_from_nested_list | ref | function | str(get_value_from_nested_list(other_side, index)),
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 196 | get_value_from_nested_list | ref | function | str(get_value_from_nested_list(approx_side_as_list, index)),
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 200 | _compare_approx | ref | function | return _compare_approx(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 225 | _yield_comparisons | def | function | def _yield_comparisons(self, actual):
"""Yield all the pairs of numbers to be compared.
This is used to implement the `__eq__` method.
"""
raise NotImplementedError
def _check_type(self) -> None:
"""Raise a TypeError if the expected value is not a valid type."""
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 240 | ApproxMapping | def | class | __repr__ _repr_compare __eq__ _yield_comparisons _check_type |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 246 | _approx_scalar | ref | function | {k: self._approx_scalar(v) for k, v in self.expected.items()}
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 249 | _repr_compare | def | function | def _repr_compare(self, other_side: Mapping[object, float]) -> List[str]:
import math
approx_side_as_map = {
k: self._approx_scalar(v) for k, v in self.expected.items()
}
number_of_elements = len(approx_side_as_map)
max_abs_diff = -math.inf
max_rel_diff ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 253 | _approx_scalar | ref | function | k: self._approx_scalar(v) for k, v in self.expected.items()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 278 | _compare_approx | ref | function | return _compare_approx(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 296 | _yield_comparisons | def | function | def _yield_comparisons(self, actual):
"""Yield all the pairs of numbers to be compared.
This is used to implement the `__eq__` method.
"""
raise NotImplementedError
def _check_type(self) -> None:
"""Raise a TypeError if the expected value is not a valid type."""
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 300 | _check_type | def | function | def _check_type(self) -> None:
"""Raise a TypeError if the expected value is not a valid type."""
# This is only a concern if the expected value is a sequence. In every
# other case, the approx() function ensures that the expected value has
# a numeric type. For this reason, the de... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 308 | ApproxSequencelike | def | class | __repr__ _repr_compare __eq__ _yield_comparisons _check_type |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 316 | seq_type | ref | function | seq_type(self._approx_scalar(x) for x in self.expected)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 316 | _approx_scalar | ref | function | seq_type(self._approx_scalar(x) for x in self.expected)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 319 | _repr_compare | def | function | def _repr_compare(self, other_side: Sequence[float]) -> List[str]:
import math
import numpy as np
if len(self.expected) != len(other_side):
return [
"Impossible to compare lists with different sizes.",
f"Lengths: {len(self.expected)} and {len(othe... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 329 | _recursive_list_map | ref | function | approx_side_as_map = _recursive_list_map(self._approx_scalar, self.expected)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 352 | _compare_approx | ref | function | return _compare_approx(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 369 | _yield_comparisons | def | function | def _yield_comparisons(self, actual):
"""Yield all the pairs of numbers to be compared.
This is used to implement the `__eq__` method.
"""
raise NotImplementedError
def _check_type(self) -> None:
"""Raise a TypeError if the expected value is not a valid type."""
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 372 | _check_type | def | function | def _check_type(self) -> None:
"""Raise a TypeError if the expected value is not a valid type."""
# This is only a concern if the expected value is a sequence. In every
# other case, the approx() function ensures that the expected value has
# a numeric type. For this reason, the de... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 380 | ApproxScalar | def | class | __repr__ __eq__ tolerance |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 420 | _as_numpy_array | ref | function | asarray = _as_numpy_array(actual)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 462 | tolerance | def | function | def tolerance(self):
"""Return the tolerance for the comparison.
This could be either an absolute tolerance or a relative tolerance,
depending on what the user specified or which would be larger.
"""
def set_default(x, default):
return x if x is not None else de... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 469 | set_default | def | function | def set_default(x, default):
return x if x is not None else default
# Figure out what the absolute tolerance should be. ``self.abs`` is
# either None or a value specified by the user.
absolute_tolerance = set_default(self.abs, self.DEFAULT_ABSOLUTE_TOLERANCE)
if ab... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 474 | set_default | ref | function | absolute_tolerance = set_default(self.abs, self.DEFAULT_ABSOLUTE_TOLERANCE)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 494 | set_default | ref | function | relative_tolerance = set_default(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 509 | ApproxDecimal | def | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 516 | approx | def | function | null |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 706 | _is_numpy_array | ref | function | elif _is_numpy_array(expected):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 707 | _as_numpy_array | ref | function | expected = _as_numpy_array(expected)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 719 | cls | ref | function | return cls(expected, rel, abs, nan_ok)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 722 | _is_numpy_array | def | function | def _is_numpy_array(obj: object) -> bool:
"""
Return true if the given object is implicitly convertible to ndarray,
and numpy is already imported.
"""
return _as_numpy_array(obj) is not None
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 727 | _as_numpy_array | ref | function | return _as_numpy_array(obj) is not None
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 730 | _as_numpy_array | def | function | def _as_numpy_array(obj: object) -> Optional["ndarray"]:
"""
Return an ndarray if the given object is implicitly convertible to ndarray,
and numpy is already imported, otherwise None.
"""
import sys
np: Any = sys.modules.get("numpy")
if np is not None:
# avoid infinite recursion on ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 755 | raises | def | function | def raises(
expected_exception: Union[Type[E], Tuple[Type[E], ...]],
*,
match: Optional[Union[str, Pattern[str]]] = ...,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 764 | raises | def | function | def raises(
expected_exception: Union[Type[E], Tuple[Type[E], ...]],
*,
match: Optional[Union[str, Pattern[str]]] = ...,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 773 | raises | def | function | def raises(
expected_exception: Union[Type[E], Tuple[Type[E], ...]],
*,
match: Optional[Union[str, Pattern[str]]] = ...,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 905 | RaisesContext | ref | function | return RaisesContext(expected_exception, message, match)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 911 | func | ref | function | func(*args[1:], **kwargs)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 915 | from_exc_info | ref | function | return _pytest._code.ExceptionInfo.from_exc_info(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 918 | fail | ref | function | fail(message)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 926 | RaisesContext | def | class | __init__ __enter__ __exit__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 938 | __enter__ | def | function | def __enter__(self) -> _pytest._code.ExceptionInfo[E]:
self.excinfo = _pytest._code.ExceptionInfo.for_later()
return self.excinfo
def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType],
)... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 939 | for_later | ref | function | self.excinfo = _pytest._code.ExceptionInfo.for_later()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 942 | __exit__ | def | function | def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType],
) -> bool:
__tracebackhide__ = _True
if exc_type is None:
fail(self.message)
assert self.excinfo is not None
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 950 | fail | ref | function | fail(self.message)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 956 | fill_unfilled | ref | function | self.excinfo.fill_unfilled(exc_info)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/python_api.py | src/_pytest/python_api.py | 958 | match | ref | function | self.excinfo.match(self.match_expr)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 7 | pytest_addoption | def | function | def pytest_addoption(parser: Parser) -> None:
parser.addini("pythonpath", type="paths", help="Add paths to sys.path", default=[])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 8 | addini | ref | function | parser.addini("pythonpath", type="paths", help="Add paths to sys.path", default=[])
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 11 | hookimpl | ref | function | @pytest.hookimpl(tryfirst=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 12 | pytest_load_initial_conftests | def | function | def pytest_load_initial_conftests(early_config: Config) -> None:
# `pythonpath = a b` will set `sys.path` to `[a, b, x, y, z, ...]`
for path in reversed(early_config.getini("pythonpath")):
sys.path.insert(0, str(path))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 14 | getini | ref | function | for path in reversed(early_config.getini("pythonpath")):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 18 | hookimpl | ref | function | @pytest.hookimpl(trylast=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 19 | pytest_unconfigure | def | function | def pytest_unconfigure(config: Config) -> None:
for path in config.getini("pythonpath"):
path_str = str(path)
if path_str in sys.path:
sys.path.remove(path_str)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/pythonpath.py | src/_pytest/pythonpath.py | 20 | getini | ref | function | for path in config.getini("pythonpath"):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 28 | recwarn | def | function | def recwarn() -> Generator["WarningsRecorder", None, None]:
"""Return a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.
See https://docs.python.org/library/how-to/capture-warnings.html for information
on warning categories.
"""
wrec = WarningsRecorder(_ispyte... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 34 | WarningsRecorder | ref | function | wrec = WarningsRecorder(_ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 41 | deprecated_call | def | function | def deprecated_call(
*, match: Optional[Union[str, Pattern[str]]] = ...
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 48 | deprecated_call | def | function | def deprecated_call(func: Callable[..., T], *args: Any, **kwargs: Any) -> T:
...
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 52 | deprecated_call | def | function | def deprecated_call(
*, match: Optional[Union[str, Pattern[str]]] = ...
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 81 | warns | ref | function | return warns((DeprecationWarning, PendingDeprecationWarning), *args, **kwargs)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 85 | warns | def | function | def warns(
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = ...,
*,
match: Optional[Union[str, Pattern[str]]] = ...,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 94 | warns | def | function | def warns(
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = ...,
*,
match: Optional[Union[str, Pattern[str]]] = ...,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 103 | warns | def | function | def warns(
expected_warning: Union[Type[Warning], Tuple[Type[Warning], ...]] = ...,
*,
match: Optional[Union[str, Pattern[str]]] = ...,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/recwarn.py | src/_pytest/recwarn.py | 148 | WarningsChecker | ref | function | return WarningsChecker(expected_warning, match_expr=match, _ispytest=True)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.