/opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest
NameSizeModeActions
assertion/-0755rm
config/-0755rm
mark/-0755rm
_code/-0755rm
_io/-0755rm
_py/-0755rm
__pycache__/-0755rm
cacheprovider.py213920644editdlrm
capture.py347370644editdlrm
compat.py132000644editdlrm
debugging.py134980644editdlrm
deprecated.py54870644editdlrm
doctest.py259610644editdlrm
faulthandler.py31140644editdlrm
fixtures.py670850644editdlrm
freeze_support.py13390644editdlrm
helpconfig.py85380644editdlrm
hookspec.py325580644editdlrm
junitxml.py257160644editdlrm
legacypath.py169290644editdlrm
logging.py340310644editdlrm
main.py324910644editdlrm
monkeypatch.py148570644editdlrm
nodes.py265590644editdlrm
nose.py16880644editdlrm
outcomes.py102560644editdlrm
pastebin.py39490644editdlrm
pathlib.py258240644editdlrm
py.typed00644editdlrm
pytester.py619710644editdlrm
pytester_assertions.py23270644editdlrm
python.py711550644editdlrm
python_api.py384000644editdlrm
python_path.py7090644editdlrm
recwarn.py109300644editdlrm
reports.py208400644editdlrm
runner.py184470644editdlrm
scope.py28820644editdlrm
setuponly.py32610644editdlrm
setupplan.py12140644editdlrm
skipping.py102000644editdlrm
stash.py30550644editdlrm
stepwise.py47140644editdlrm
terminal.py535090644editdlrm
threadexception.py29150644editdlrm
timing.py3750644editdlrm
tmpdir.py117080644editdlrm
unittest.py148090644editdlrm
unraisableexception.py31910644editdlrm
warnings.py50700644editdlrm
warning_types.py44740644editdlrm
_argcomplete.py37940644editdlrm
_version.py1600644editdlrm
__init__.py3560644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/nose.py (1688B)
"""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