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

Method cwd_relative_nodeid

src/_pytest/config/__init__.py:1273–1282  ·  view source on GitHub ↗
(self, nodeid: str)

Source from the content-addressed store, hash-verified

1271 sys.stderr.flush()
1272
1273 def cwd_relative_nodeid(self, nodeid: str) -> str:
1274 # nodeid's are relative to the rootpath, compute relative to cwd.
1275 if self.invocation_params.dir != self.rootpath:
1276 base_path_part, *nodeid_part = nodeid.split("::")
1277 # Only process path part
1278 fullpath = self.rootpath / base_path_part
1279 relative_path = bestrelpath(self.invocation_params.dir, fullpath)
1280
1281 nodeid = "::".join([relative_path, *nodeid_part])
1282 return nodeid
1283
1284 @classmethod
1285 def fromdictargs(cls, option_dict: Mapping[str, Any], args: list[str]) -> Config:

Callers 2

mkrelMethod · 0.80
_get_node_id_with_markupFunction · 0.80

Calls 2

bestrelpathFunction · 0.90
joinMethod · 0.80

Tested by

no test coverage detected