X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
_pytest
/
??
..
??
__init__.py
(356 B)
??
__pycache__
??
_argcomplete.py
(3.71 KB)
??
_code
??
_io
??
_py
??
_version.py
(160 B)
??
assertion
??
cacheprovider.py
(20.89 KB)
??
capture.py
(33.92 KB)
??
compat.py
(12.89 KB)
??
config
??
debugging.py
(13.18 KB)
??
deprecated.py
(5.36 KB)
??
doctest.py
(25.35 KB)
??
faulthandler.py
(3.04 KB)
??
fixtures.py
(65.51 KB)
??
freeze_support.py
(1.31 KB)
??
helpconfig.py
(8.34 KB)
??
hookspec.py
(31.79 KB)
??
junitxml.py
(25.11 KB)
??
legacypath.py
(16.53 KB)
??
logging.py
(33.23 KB)
??
main.py
(31.73 KB)
??
mark
??
monkeypatch.py
(14.51 KB)
??
nodes.py
(25.94 KB)
??
nose.py
(1.65 KB)
??
outcomes.py
(10.02 KB)
??
pastebin.py
(3.86 KB)
??
pathlib.py
(25.22 KB)
??
py.typed
(0 B)
??
pytester.py
(60.52 KB)
??
pytester_assertions.py
(2.27 KB)
??
python.py
(69.49 KB)
??
python_api.py
(37.5 KB)
??
python_path.py
(709 B)
??
recwarn.py
(10.67 KB)
??
reports.py
(20.35 KB)
??
runner.py
(18.01 KB)
??
scope.py
(2.81 KB)
??
setuponly.py
(3.18 KB)
??
setupplan.py
(1.19 KB)
??
skipping.py
(9.96 KB)
??
stash.py
(2.98 KB)
??
stepwise.py
(4.6 KB)
??
terminal.py
(52.25 KB)
??
threadexception.py
(2.85 KB)
??
timing.py
(375 B)
??
tmpdir.py
(11.43 KB)
??
unittest.py
(14.46 KB)
??
unraisableexception.py
(3.12 KB)
??
warning_types.py
(4.37 KB)
??
warnings.py
(4.95 KB)
Editing: warning_types.py
import dataclasses import inspect import warnings from types import FunctionType from typing import Any from typing import Generic from typing import Type from typing import TypeVar from _pytest.compat import final class PytestWarning(UserWarning): """Base class for all warnings emitted by pytest.""" __module__ = "pytest" @final class PytestAssertRewriteWarning(PytestWarning): """Warning emitted by the pytest assert rewrite module.""" __module__ = "pytest" @final class PytestCacheWarning(PytestWarning): """Warning emitted by the cache plugin in various situations.""" __module__ = "pytest" @final class PytestConfigWarning(PytestWarning): """Warning emitted for configuration issues.""" __module__ = "pytest" @final class PytestCollectionWarning(PytestWarning): """Warning emitted when pytest is not able to collect a file or symbol in a module.""" __module__ = "pytest" class PytestDeprecationWarning(PytestWarning, DeprecationWarning): """Warning class for features that will be removed in a future version.""" __module__ = "pytest" class PytestRemovedIn8Warning(PytestDeprecationWarning): """Warning class for features that will be removed in pytest 8.""" __module__ = "pytest" class PytestReturnNotNoneWarning(PytestRemovedIn8Warning): """Warning emitted when a test function is returning value other than None.""" __module__ = "pytest" @final class PytestExperimentalApiWarning(PytestWarning, FutureWarning): """Warning category used to denote experiments in pytest. Use sparingly as the API might change or even be removed completely in a future version. """ __module__ = "pytest" @classmethod def simple(cls, apiname: str) -> "PytestExperimentalApiWarning": return cls( "{apiname} is an experimental api that may change over time".format( apiname=apiname ) ) @final class PytestUnhandledCoroutineWarning(PytestReturnNotNoneWarning): """Warning emitted for an unhandled coroutine. A coroutine was encountered when collecting test functions, but was not handled by any async-aware plugin. Coroutine test functions are not natively supported. """ __module__ = "pytest" @final class PytestUnknownMarkWarning(PytestWarning): """Warning emitted on use of unknown markers. See :ref:`mark` for details. """ __module__ = "pytest" @final class PytestUnraisableExceptionWarning(PytestWarning): """An unraisable exception was reported. Unraisable exceptions are exceptions raised in :meth:`__del__ <object.__del__>` implementations and similar situations when the exception cannot be raised as normal. """ __module__ = "pytest" @final class PytestUnhandledThreadExceptionWarning(PytestWarning): """An unhandled exception occurred in a :class:`~threading.Thread`. Such exceptions don't propagate normally. """ __module__ = "pytest" _W = TypeVar("_W", bound=PytestWarning) @final @dataclasses.dataclass class UnformattedWarning(Generic[_W]): """A warning meant to be formatted during runtime. This is used to hold warnings that need to format their message at runtime, as opposed to a direct message. """ category: Type["_W"] template: str def format(self, **kwargs: Any) -> _W: """Return an instance of the warning category, formatted with given kwargs.""" return self.category(self.template.format(**kwargs)) def warn_explicit_for(method: FunctionType, message: PytestWarning) -> None: """ Issue the warning :param:`message` for the definition of the given :param:`method` this helps to log warnings for functions defined prior to finding an issue with them (like hook wrappers being marked in a legacy mechanism) """ lineno = method.__code__.co_firstlineno filename = inspect.getfile(method) module = method.__module__ mod_globals = method.__globals__ try: warnings.warn_explicit( message, type(message), filename=filename, module=module, registry=mod_globals.setdefault("__warningregistry__", {}), lineno=lineno, ) except Warning as w: # If warnings are errors (e.g. -Werror), location information gets lost, so we add it to the message. raise type(w)(f"{w}\n at {filename}:{lineno}") from None
Upload File
Create Folder