MCPcopy
hub / github.com/pytest-dev/pytest / pytest_plugin_registered

Method pytest_plugin_registered

src/_pytest/fixtures.py:1776–1792  ·  view source on GitHub ↗
(self, plugin: _PluggyPlugin, plugin_name: str)

Source from the content-addressed store, hash-verified

1774 return FuncFixtureInfo(argnames, initialnames, names_closure, arg2fixturedefs)
1775
1776 def pytest_plugin_registered(self, plugin: _PluggyPlugin, plugin_name: str) -> None:
1777 # Fixtures defined in conftest plugins are only visible to within the
1778 # conftest's directory. This is unlike fixtures in non-conftest plugins
1779 # which have global visibility. Conftest fixtures are deferred until
1780 # their Directory is collected, so we can use the Directory's nodeid.
1781 if plugin_name and plugin_name.endswith("conftest.py"):
1782 # Note: we explicitly do *not* use `plugin.__file__` here -- The
1783 # difference is that plugin_name has the correct capitalization on
1784 # case-insensitive systems (Windows) and other normalization issues
1785 # (issue #11816).
1786 conftestpath = absolutepath(plugin_name)
1787 conftest_dir = conftestpath.parent
1788 # Store conftest for deferred parsing when its Directory is collected.
1789 self._pending_conftests[conftest_dir] = plugin
1790 else:
1791 # Non-conftest plugins have global visibility.
1792 self.parsefactories(holder=plugin, node=self.session)
1793
1794 @hookimpl(wrapper=True)
1795 def pytest_make_collect_report(

Callers

nothing calls this directly

Calls 3

parsefactoriesMethod · 0.95
absolutepathFunction · 0.90
endswithMethod · 0.80

Tested by

no test coverage detected