| 1211 | |
| 1212 | @pytest.mark.skipif(not hasattr(os, "symlink"), reason="os.symlink not available") |
| 1213 | def 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 | |
| 1226 | def test_listdir_single_arg(tmpdir): |