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

Method _format_fixturedef_line

src/_pytest/fixtures.py:887–893  ·  view source on GitHub ↗
(self, fixturedef: FixtureDef[object])

Source from the content-addressed store, hash-verified

885 )
886
887 def _format_fixturedef_line(self, fixturedef: FixtureDef[object]) -> str:
888 factory = fixturedef.func
889 path, lineno = getfslineno(factory)
890 if isinstance(path, Path):
891 path = bestrelpath(self._pyfuncitem.session.path, path)
892 sig = signature(factory)
893 return f"{path}:{lineno + 1}: def {factory.__name__}{sig}"
894
895 def addfinalizer(self, finalizer: Callable[[], object]) -> None:
896 self._fixturedef.addfinalizer(finalizer)

Callers 1

_check_scopeMethod · 0.95

Calls 3

getfslinenoFunction · 0.90
bestrelpathFunction · 0.90
signatureFunction · 0.90

Tested by

no test coverage detected