/
usr
/
lib
/
imh-dnskeyapi
/
venv
/
lib
/
python3.13
/
site-packages
/
_pytest
/
/usr/lib/imh-dnskeyapi/venv/lib/python3.13/site-packages/_pytest
mkdir
upload
Name
Size
Mode
Actions
assertion/
-
0755
rm
config/
-
0755
rm
mark/
-
0755
rm
_code/
-
0755
rm
_io/
-
0755
rm
_py/
-
0755
rm
cacheprovider.py
22373
0644
edit
dl
rm
capture.py
35330
0644
edit
dl
rm
compat.py
11467
0644
edit
dl
rm
debugging.py
13260
0644
edit
dl
rm
deprecated.py
3147
0644
edit
dl
rm
doctest.py
26255
0644
edit
dl
rm
faulthandler.py
3674
0644
edit
dl
rm
fixtures.py
73550
0644
edit
dl
rm
freeze_support.py
1291
0644
edit
dl
rm
helpconfig.py
8895
0644
edit
dl
rm
hookspec.py
42831
0644
edit
dl
rm
junitxml.py
25574
0644
edit
dl
rm
legacypath.py
16588
0644
edit
dl
rm
logging.py
35124
0644
edit
dl
rm
main.py
37416
0644
edit
dl
rm
monkeypatch.py
14598
0644
edit
dl
rm
nodes.py
26483
0644
edit
dl
rm
outcomes.py
10532
0644
edit
dl
rm
pastebin.py
3978
0644
edit
dl
rm
pathlib.py
37569
0644
edit
dl
rm
py.typed
0
0644
edit
dl
rm
pytester.py
61552
0644
edit
dl
rm
pytester_assertions.py
2244
0644
edit
dl
rm
python.py
64851
0644
edit
dl
rm
python_api.py
40122
0644
edit
dl
rm
python_path.py
745
0644
edit
dl
rm
recwarn.py
13227
0644
edit
dl
rm
reports.py
21331
0644
edit
dl
rm
runner.py
19436
0644
edit
dl
rm
scope.py
2798
0644
edit
dl
rm
setuponly.py
3306
0644
edit
dl
rm
setupplan.py
1184
0644
edit
dl
rm
skipping.py
10217
0644
edit
dl
rm
stash.py
3090
0644
edit
dl
rm
stepwise.py
4596
0644
edit
dl
rm
terminal.py
57393
0644
edit
dl
rm
threadexception.py
3005
0644
edit
dl
rm
timing.py
413
0644
edit
dl
rm
tmpdir.py
11375
0644
edit
dl
rm
unittest.py
15614
0644
edit
dl
rm
unraisableexception.py
3252
0644
edit
dl
rm
warnings.py
5211
0644
edit
dl
rm
warning_types.py
4388
0644
edit
dl
rm
_argcomplete.py
3776
0644
edit
dl
rm
_version.py
511
0644
edit
dl
rm
__init__.py
391
0644
edit
dl
rm
Edit:
/usr/lib/imh-dnskeyapi/venv/lib/python3.13/site-packages/_pytest/unraisableexception.py
(3252B)
from __future__ import annotations import sys import traceback from types import TracebackType from typing import Any from typing import Callable from typing import Generator from typing import TYPE_CHECKING import warnings import pytest if TYPE_CHECKING: from typing_extensions import Self # Copied from cpython/Lib/test/support/__init__.py, with modifications. class catch_unraisable_exception: """Context manager catching unraisable exception using sys.unraisablehook. Storing the exception value (cm.unraisable.exc_value) creates a reference cycle. The reference cycle is broken explicitly when the context manager exits. Storing the object (cm.unraisable.object) can resurrect it if it is set to an object which is being finalized. Exiting the context manager clears the stored object. Usage: with catch_unraisable_exception() as cm: # code creating an "unraisable exception" ... # check the unraisable exception: use cm.unraisable ... # cm.unraisable attribute no longer exists at this point # (to break a reference cycle) """ def __init__(self) -> None: self.unraisable: sys.UnraisableHookArgs | None = None self._old_hook: Callable[[sys.UnraisableHookArgs], Any] | None = None 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) -> Self: self._old_hook = sys.unraisablehook sys.unraisablehook = self._hook return self def __exit__( self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, ) -> None: assert self._old_hook is not None sys.unraisablehook = self._old_hook self._old_hook = None del self.unraisable def unraisable_exception_runtest_hook() -> Generator[None]: with catch_unraisable_exception() as cm: try: yield finally: if cm.unraisable: if cm.unraisable.err_msg is not None: err_msg = cm.unraisable.err_msg else: err_msg = "Exception ignored in" msg = f"{err_msg}: {cm.unraisable.object!r}\n\n" msg += "".join( traceback.format_exception( cm.unraisable.exc_type, cm.unraisable.exc_value, cm.unraisable.exc_traceback, ) ) warnings.warn(pytest.PytestUnraisableExceptionWarning(msg)) @pytest.hookimpl(wrapper=True, tryfirst=True) def pytest_runtest_setup() -> Generator[None]: yield from unraisable_exception_runtest_hook() @pytest.hookimpl(wrapper=True, tryfirst=True) def pytest_runtest_call() -> Generator[None]: yield from unraisable_exception_runtest_hook() @pytest.hookimpl(wrapper=True, tryfirst=True) def pytest_runtest_teardown() -> Generator[None]: yield from unraisable_exception_runtest_hook()
Save
cmd:
run