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

Method parse_hookspec_opts

src/_pytest/config/__init__.py:430–445  ·  view source on GitHub ↗
(self, module_or_class, name: str)

Source from the content-addressed store, hash-verified

428 return opts
429
430 def parse_hookspec_opts(self, module_or_class, name: str):
431 opts = super().parse_hookspec_opts(module_or_class, name)
432 if opts is None:
433 method = getattr(module_or_class, name)
434
435 if name.startswith("pytest_"):
436 # todo: deprecate hookspec hacks
437 # https://github.com/pytest-dev/pytest/issues/4562
438 known_marks = {m.name for m in getattr(method, "pytestmark", [])}
439 opts = {
440 "firstresult": hasattr(method, "firstresult")
441 or "firstresult" in known_marks,
442 "historic": hasattr(method, "historic")
443 or "historic" in known_marks,
444 }
445 return opts
446
447 def register(
448 self, plugin: _PluggyPlugin, name: Optional[str] = None

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected