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/tmpdir.py | src/_pytest/tmpdir.py | 176 | add_cleanup | ref | function | config.add_cleanup(mp.undo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/tmpdir.py | src/_pytest/tmpdir.py | 177 | from_config | ref | function | _tmp_path_factory = TempPathFactory.from_config(config, _ispytest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/tmpdir.py | src/_pytest/tmpdir.py | 181 | fixture | ref | function | @fixture(scope="session")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/tmpdir.py | src/_pytest/tmpdir.py | 182 | tmp_path_factory | def | function | def tmp_path_factory(request: FixtureRequest) -> TempPathFactory:
"""Return a :class:`pytest.TempPathFactory` instance for the test session."""
# Set dynamically by pytest_configure() above.
return request.config._tmp_path_factory # type: ignore
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/tmpdir.py | src/_pytest/tmpdir.py | 188 | _mk_tmp | def | function | def _mk_tmp(request: FixtureRequest, factory: TempPathFactory) -> Path:
name = request.node.name
name = re.sub(r"[\W]", "_", name)
MAXVAL = 30
name = name[:MAXVAL]
return factory.mktemp(name, numbered=_True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/tmpdir.py | src/_pytest/tmpdir.py | 197 | tmp_path | def | function | def tmp_path(request: FixtureRequest, tmp_path_factory: TempPathFactory) -> Path:
"""Return a temporary directory path object which is unique to each test
function invocation, created as a sub directory of the base temporary
directory.
By default, a new base temporary directory is created each test ses... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/tmpdir.py | src/_pytest/tmpdir.py | 210 | _mk_tmp | ref | function | return _mk_tmp(request, tmp_path_factory)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 43 | pytest_pycollect_makeitem | def | function | def pytest_pycollect_makeitem(
collector: PyCollector, name: str, obj: object
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 55 | from_parent | ref | function | item: UnitTestCase = UnitTestCase.from_parent(collector, name=name, obj=obj)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 59 | UnitTestCase | def | class | collect _inject_setup_teardown_fixtures |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 64 | collect | def | function | def collect(self) -> Iterable[Union[Item, Collector]]:
from unittest import TestLoader
cls = self.obj
if not getattr(cls, "__test__", _True):
return
skipped = _is_skipped(cls)
if not skipped:
self._inject_setup_teardown_fixtures(cls)
self... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 71 | _is_skipped | ref | function | skipped = _is_skipped(cls)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 73 | _inject_setup_teardown_fixtures | ref | function | self._inject_setup_teardown_fixtures(cls)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 74 | _inject_setup_class_fixture | ref | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 76 | parsefactories | ref | function | self.session._fixturemanager.parsefactories(self, unittest=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 77 | TestLoader | ref | function | loader = TestLoader()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 79 | getTestCaseNames | ref | function | for name in loader.getTestCaseNames(self.obj):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 83 | getimfunc | ref | function | funcobj = getimfunc(x)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 84 | from_parent | ref | function | yield TestCaseFunction.from_parent(self, name=name, callobj=funcobj)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 93 | from_parent | ref | function | yield TestCaseFunction.from_parent(self, name="runTest")
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 95 | _inject_setup_teardown_fixtures | def | function | def _inject_setup_teardown_fixtures(self, cls: type) -> None:
"""Injects a hidden auto-use fixture to invoke setUpClass/setup_method and corresponding
teardown functions (#517)."""
class_fixture = _make_xunit_fixture(
cls,
"setUpClass",
"tearDownClass",
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 98 | _make_xunit_fixture | ref | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 109 | _make_xunit_fixture | ref | function | method_fixture = _make_xunit_fixture(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 121 | _make_xunit_fixture | def | function | def _make_xunit_fixture(
obj: type,
setup_name: str,
teardown_name: str,
cleanup_name: Optional[str],
scope: Scope,
pass_self: bool,
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 138 | cleanup | def | function | def cleanup(*args):
pass
@pytest.fixture(
scope=scope.value,
autouse=_True,
# Use a unique name to speed up lookup.
name=f"_unittest_{setup_name}_fixture_{obj.__qualname__}",
)
def fixture(self, request: FixtureRequest) -> Generator[None, None, None]:
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 141 | fixture | ref | function | @pytest.fixture(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 147 | fixture | def | function | def fixture(self, request: FixtureRequest) -> Generator[None, None, None]:
if _is_skipped(self):
reason = self.__unittest_skip_why__
raise pytest.skip.Exception(reason, _use_item_location=_True)
if setup is not None:
try:
if pass_self:
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 148 | _is_skipped | ref | function | if _is_skipped(self):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 154 | setup | ref | function | setup(self, request.function)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 156 | setup | ref | function | setup()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 161 | cleanup | ref | function | cleanup(self)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 163 | cleanup | ref | function | cleanup()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 170 | teardown | ref | function | teardown(self, request.function)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 172 | teardown | ref | function | teardown()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 175 | cleanup | ref | function | cleanup(self)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 177 | cleanup | ref | function | cleanup()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 182 | TestCaseFunction | def | class | setup teardown startTest _addexcinfo addError addFailure addSkip addExpectedFailure addUnexpectedSuccess addSuccess stopTest runtest _prunetraceback |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 187 | setup | def | function | def setup(self) -> None:
# A bound method to be called during teardown() if set (see 'runtest()').
self._explicit_tearDown: Optional[Callable[[], None]] = None
assert self.parent is not None
self._testcase = self.parent.obj(self.name) # type: ignore[attr-defined]
self._obj =... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 191 | obj | ref | function | self._testcase = self.parent.obj(self.name) # type: ignore[attr-defined]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 194 | _fillfixtures | ref | function | self._request._fillfixtures()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 196 | teardown | def | function | def teardown(self) -> None:
if self._explicit_tearDown is not None:
self._explicit_tearDown()
self._explicit_tearDown = None
self._testcase = None
self._obj = None
def startTest(self, testcase: "unittest.TestCase") -> None:
pass
def _addexcinfo(self,... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 198 | _explicit_tearDown | ref | function | self._explicit_tearDown()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 203 | startTest | def | function | def startTest(self, testcase: "unittest.TestCase") -> None:
pass
def _addexcinfo(self, rawexcinfo: "_SysExcInfoType") -> None:
# Unwrap potential exception info (see twisted trial support below).
rawexcinfo = getattr(rawexcinfo, "_rawexcinfo", rawexcinfo)
try:
excinf... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 206 | _addexcinfo | def | function | def _addexcinfo(self, rawexcinfo: "_SysExcInfoType") -> None:
# Unwrap potential exception info (see twisted trial support below).
rawexcinfo = getattr(rawexcinfo, "_rawexcinfo", rawexcinfo)
try:
excinfo = _pytest._code.ExceptionInfo[BaseException].from_exc_info(rawexcinfo) # ty... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 210 | from_exc_info | ref | function | excinfo = _pytest._code.ExceptionInfo[BaseException].from_exc_info(rawexcinfo) # type: ignore[arg-type]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 224 | fail | ref | function | fail("".join(values), pytrace=False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 228 | fail | ref | function | fail(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 236 | from_current | ref | function | excinfo = _pytest._code.ExceptionInfo.from_current()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 239 | addError | def | function | def addError(
self, testcase: "unittest.TestCase", rawexcinfo: "_SysExcInfoType"
) -> None:
try:
if isinstance(rawexcinfo[1], exit.Exception):
exit(rawexcinfo[1].msg)
except TypeError:
pass
self._addexcinfo(rawexcinfo)
def addFailure(
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 247 | _addexcinfo | ref | function | self._addexcinfo(rawexcinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 249 | addFailure | def | function | def addFailure(
self, testcase: "unittest.TestCase", rawexcinfo: "_SysExcInfoType"
) -> None:
self._addexcinfo(rawexcinfo)
def addSkip(self, testcase: "unittest.TestCase", reason: str) -> None:
try:
raise pytest.skip.Exception(reason, _use_item_location=_True)
ex... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 252 | _addexcinfo | ref | function | self._addexcinfo(rawexcinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 254 | addSkip | def | function | def addSkip(self, testcase: "unittest.TestCase", reason: str) -> None:
try:
raise pytest.skip.Exception(reason, _use_item_location=_True)
except skip.Exception:
self._addexcinfo(sys.exc_info())
def addExpectedFailure(
self,
testcase: "unittest.TestCase",
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 258 | _addexcinfo | ref | function | self._addexcinfo(sys.exc_info())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 260 | addExpectedFailure | def | function | def addExpectedFailure(
self,
testcase: "unittest.TestCase",
rawexcinfo: "_SysExcInfoType",
reason: str = "",
) -> None:
try:
xfail(str(reason))
except xfail.Exception:
self._addexcinfo(sys.exc_info())
def addUnexpectedSuccess(
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 267 | xfail | ref | function | xfail(str(reason))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 269 | _addexcinfo | ref | function | self._addexcinfo(sys.exc_info())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 271 | addUnexpectedSuccess | def | function | def addUnexpectedSuccess(
self,
testcase: "unittest.TestCase",
reason: Optional["twisted.trial.unittest.Todo"] = None,
) -> None:
msg = "Unexpected success"
if reason:
msg += f": {reason.reason}"
# Preserve unittest behaviour - fail the test. Explicitl... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 281 | fail | ref | function | fail(msg, pytrace=False)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 283 | _addexcinfo | ref | function | self._addexcinfo(sys.exc_info())
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 285 | addSuccess | def | function | def addSuccess(self, testcase: "unittest.TestCase") -> None:
pass
def stopTest(self, testcase: "unittest.TestCase") -> None:
pass
def runtest(self) -> None:
from _pytest.debugging import maybe_wrap_pytest_function_for_tracing
assert self._testcase is not None
mayb... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 288 | stopTest | def | function | def stopTest(self, testcase: "unittest.TestCase") -> None:
pass
def runtest(self) -> None:
from _pytest.debugging import maybe_wrap_pytest_function_for_tracing
assert self._testcase is not None
maybe_wrap_pytest_function_for_tracing(self)
# Let the unittest framework ... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 291 | runtest | def | function | def runtest(self) -> None:
from _pytest.debugging import maybe_wrap_pytest_function_for_tracing
assert self._testcase is not None
maybe_wrap_pytest_function_for_tracing(self)
# Let the unittest framework handle async functions.
if is_async_function(self.obj):
#... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 296 | maybe_wrap_pytest_function_for_tracing | ref | function | maybe_wrap_pytest_function_for_tracing(self)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 299 | is_async_function | ref | function | if is_async_function(self.obj):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 301 | _testcase | ref | function | self._testcase(result=self) # type: ignore[arg-type]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 309 | getoption | ref | function | if self.config.getoption("usepdb") and not _is_skipped(self.obj):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 309 | _is_skipped | ref | function | if self.config.getoption("usepdb") and not _is_skipped(self.obj):
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 317 | _testcase | ref | function | self._testcase(result=self) # type: ignore[arg-type]
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 321 | _prunetraceback | def | function | def _prunetraceback(
self, excinfo: _pytest._code.ExceptionInfo[BaseException]
) -> None:
super()._prunetraceback(excinfo)
traceback = excinfo.traceback.filter(
lambda x: not x.frame.f_globals.get("__unittest")
)
if traceback:
excinfo.traceback = t... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 324 | _prunetraceback | ref | function | super()._prunetraceback(excinfo)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 332 | hookimpl | ref | function | @hookimpl(tryfirst=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 333 | pytest_runtest_makereport | def | function | def pytest_runtest_makereport(item: Item, call: CallInfo[None]) -> None:
if isinstance(item, TestCaseFunction):
if item._excinfo:
call.excinfo = item._excinfo.pop(0)
try:
del call.result
except AttributeError:
pass
# Convert unittest.S... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 353 | from_call | ref | function | call2 = CallInfo[None].from_call(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 354 | skip | ref | function | lambda: pytest.skip(str(excinfo.value)), call.when
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 362 | hookimpl | ref | function | @hookimpl(hookwrapper=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 363 | pytest_runtest_protocol | def | function | def pytest_runtest_protocol(item: Item) -> Generator[None, None, None]:
if isinstance(item, TestCaseFunction) and "twisted.trial.unittest" in sys.modules:
ut: Any = sys.modules["twisted.python.failure"]
Failure__init__ = ut.Failure.__init__
check_testcase_implements_trial_reporter()
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 367 | check_testcase_implements_trial_reporter | ref | function | check_testcase_implements_trial_reporter()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 369 | excstore | def | function | def excstore(
self, exc_value=None, exc_type=None, exc_tb=None, captureVars=None
):
if exc_value is None:
self._rawexcinfo = sys.exc_info()
else:
if exc_type is None:
exc_type = type(exc_value)
self._... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 379 | Failure__init__ | ref | function | Failure__init__(
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 383 | Failure__init__ | ref | function | Failure__init__(self, exc_value, exc_type, exc_tb)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 392 | check_testcase_implements_trial_reporter | def | function | def check_testcase_implements_trial_reporter(done: List[int] = []) -> None:
if done:
return
from zope.interface import classImplements
from twisted.trial.itrial import IReporter
classImplements(TestCaseFunction, IReporter)
done.append(1)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 398 | classImplements | ref | class | |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unittest.py | src/_pytest/unittest.py | 402 | _is_skipped | def | function | def _is_skipped(obj) -> bool:
"""Return _True if the given object has been marked with @unittest.skip."""
return bool(getattr(obj, "__unittest_skip__", _False))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 14 | catch_unraisable_exception | def | class | __init__ _hook __enter__ __exit__ |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 39 | _hook | def | function | def _hook(self, unraisable: "sys.UnraisableHookArgs") -> None:
# Storing unraisable.object can resurrect an object which is being
# finalized. Storing unraisable.exc_value creates a reference cycle.
self.unraisable = unraisable
def __enter__(self) -> "catch_unraisable_exception":
... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 44 | __enter__ | def | function | def __enter__(self) -> "catch_unraisable_exception":
self._old_hook = sys.unraisablehook
sys.unraisablehook = self._hook
return self
def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackT... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 49 | __exit__ | def | function | def __exit__(
self,
exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType],
) -> None:
assert self._old_hook is not None
sys.unraisablehook = self._old_hook
self._old_hook = None
del self.unraisab... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 61 | unraisable_exception_runtest_hook | def | function | def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
with catch_unraisable_exception() as cm:
yield
if cm.unraisable:
if cm.unraisable.err_msg is not None:
err_msg = cm.unraisable.err_msg
else:
err_msg = "Exception ignored in... |
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 62 | catch_unraisable_exception | ref | function | with catch_unraisable_exception() as cm:
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 77 | PytestUnraisableExceptionWarning | ref | function | warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 80 | hookimpl | ref | function | @pytest.hookimpl(hookwrapper=True, tryfirst=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 81 | pytest_runtest_setup | def | function | def pytest_runtest_setup() -> Generator[None, None, None]:
yield from unraisable_exception_runtest_hook()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 82 | unraisable_exception_runtest_hook | ref | function | yield from unraisable_exception_runtest_hook()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 85 | hookimpl | ref | function | @pytest.hookimpl(hookwrapper=True, tryfirst=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 86 | pytest_runtest_call | def | function | def pytest_runtest_call() -> Generator[None, None, None]:
yield from unraisable_exception_runtest_hook()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 87 | unraisable_exception_runtest_hook | ref | function | yield from unraisable_exception_runtest_hook()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 90 | hookimpl | ref | function | @pytest.hookimpl(hookwrapper=True, tryfirst=True)
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 91 | pytest_runtest_teardown | def | function | def pytest_runtest_teardown() -> Generator[None, None, None]:
yield from unraisable_exception_runtest_hook()
|
playground/5d9c10a9-c67f-4d61-a0f0-c84c5a279fa1/pytest/src/_pytest/unraisableexception.py | src/_pytest/unraisableexception.py | 92 | unraisable_exception_runtest_hook | ref | function | yield from unraisable_exception_runtest_hook()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.