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

Method location

src/_pytest/nodes.py:754–764  ·  view source on GitHub ↗

Returns a tuple of ``(relfspath, lineno, testname)`` for this item where ``relfspath`` is file path relative to ``config.rootpath`` and lineno is a 0-based line number.

(self)

Source from the content-addressed store, hash-verified

752
753 @cached_property
754 def location(self) -> tuple[str, int | None, str]:
755 """
756 Returns a tuple of ``(relfspath, lineno, testname)`` for this item
757 where ``relfspath`` is file path relative to ``config.rootpath``
758 and lineno is a 0-based line number.
759 """
760 location = self.reportinfo()
761 path = absolutepath(location[0])
762 relfspath = self.session._node_location_to_relpath(path)
763 assert type(location[2]) is str
764 return (relfspath, location[1], location[2])

Callers

nothing calls this directly

Calls 3

reportinfoMethod · 0.95
absolutepathFunction · 0.90

Tested by

no test coverage detected