MCPcopy Create free account
hub / github.com/pytest-dev/pytest / pytest_pycollect_makemodule

Function pytest_pycollect_makemodule

src/_pytest/hookspec.py:339–358  ·  view source on GitHub ↗

Return a Module collector or None for the given path. This hook will be called for each matching test module path. The pytest_collect_file hook needs to be used if you want to create test modules for files that do not match as a test module. Stops at first non-None result, see :ref

(
    module_path: Path, path: "LEGACY_PATH", parent
)

Source from the content-addressed store, hash-verified

337
338@hookspec(firstresult=True)
339def pytest_pycollect_makemodule(
340 module_path: Path, path: "LEGACY_PATH", parent
341) -> Optional["Module"]:
342 """Return a Module collector or None for the given path.
343
344 This hook will be called for each matching test module path.
345 The pytest_collect_file hook needs to be used if you want to
346 create test modules for files that do not match as a test module.
347
348 Stops at first non-None result, see :ref:`firstresult`.
349
350 :param pathlib.Path module_path: The path of the module to collect.
351 :param LEGACY_PATH path: The path of the module to collect (deprecated).
352
353 .. versionchanged:: 7.0.0
354 The ``module_path`` parameter was added as a :class:`pathlib.Path`
355 equivalent of the ``path`` parameter.
356
357 The ``path`` parameter has been deprecated in favor of ``fspath``.
358 """
359
360
361@hookspec(firstresult=True)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected