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: nose.py
"""Run testsuites written for nose.""" import warnings from _pytest.config import hookimpl from _pytest.deprecated import NOSE_SUPPORT from _pytest.fixtures import getfixturemarker from _pytest.nodes import Item from _pytest.python import Function from _pytest.unittest import TestCaseFunction @hookimpl(trylast=True) def pytest_runtest_setup(item: Item) -> None: if not isinstance(item, Function): return # Don't do nose style setup/teardown on direct unittest style classes. if isinstance(item, TestCaseFunction): return # Capture the narrowed type of item for the teardown closure, # see https://github.com/python/mypy/issues/2608 func = item call_optional(func.obj, "setup", func.nodeid) func.addfinalizer(lambda: call_optional(func.obj, "teardown", func.nodeid)) # NOTE: Module- and class-level fixtures are handled in python.py # with `pluginmanager.has_plugin("nose")` checks. # It would have been nicer to implement them outside of core, but # it's not straightforward. def call_optional(obj: object, name: str, nodeid: str) -> bool: method = getattr(obj, name, None) if method is None: return False is_fixture = getfixturemarker(method) is not None if is_fixture: return False if not callable(method): return False # Warn about deprecation of this plugin. method_name = getattr(method, "__name__", str(method)) warnings.warn( NOSE_SUPPORT.format(nodeid=nodeid, method=method_name, stage=name), stacklevel=2 ) # If there are any problems allow the exception to raise rather than # silently ignoring it. method() return True
Upload File
Create Folder