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

Function test_samefile_symlink

testing/_py/test_local.py:1213–1223  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

1211
1212@pytest.mark.skipif(not hasattr(os, "symlink"), reason="os.symlink not available")
1213def test_samefile_symlink(tmpdir):
1214 p1 = tmpdir.ensure("foo.txt")
1215 p2 = tmpdir.join("linked.txt")
1216 try:
1217 os.symlink(str(p1), str(p2))
1218 except (OSError, NotImplementedError) as e:
1219 # on Windows this might fail if the user doesn't have special symlink permissions
1220 # pypy3 on Windows doesn't implement os.symlink and raises NotImplementedError
1221 pytest.skip(str(e.args[0]))
1222
1223 assert p1.samefile(p2)
1224
1225
1226def test_listdir_single_arg(tmpdir):

Callers

nothing calls this directly

Calls 3

ensureMethod · 0.80
joinMethod · 0.80
samefileMethod · 0.80

Tested by

no test coverage detected