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

Method test_bestrelpath

testing/_py/test_local.py:153–165  ·  testing/_py/test_local.py::CommonFSTests.test_bestrelpath
(self, path1)

Source from the content-addressed store, hash-verified

151 assert not path1.check(relto=p)
152
153 def test_bestrelpath(self, path1):
154 curdir = path1
155 sep = curdir.sep
156 s = curdir.bestrelpath(curdir)
157 assert s == class="st">"."
158 s = curdir.bestrelpath(curdir.join(class="st">"hello", class="st">"world"))
159 assert s == class="st">"hello" + sep + class="st">"world"
160
161 s = curdir.bestrelpath(curdir.dirpath().join(class="st">"sister"))
162 assert s == class="st">".." + sep + class="st">"sister"
163 assert curdir.bestrelpath(curdir.dirpath()) == class="st">".."
164
165 assert curdir.bestrelpath(class="st">"hello") == class="st">"hello"
166
167 def test_relto_not_relative(self, path1):
168 l1 = path1.join(class="st">"bcde")

Callers

nothing calls this directly

Calls 3

bestrelpathMethod · 0.80
joinMethod · 0.80
dirpathMethod · 0.80

Tested by

no test coverage detected