skip symlink tests when `not hasattr(os, 'symlink')`

This commit is contained in:
Marcus Smith 2013-11-24 15:50:11 -08:00
parent 65c23d85a5
commit 1f5343ec31
1 changed files with 2 additions and 0 deletions

View File

@ -12,6 +12,7 @@ def test_get_path_uid_without_NOFOLLOW(monkeypatch):
path = os.getcwd()
assert get_path_uid(path) == os.stat(path).st_uid
@pytest.mark.skipif("not hasattr(os, 'symlink')")
def test_get_path_uid_symlink(tmpdir):
f = tmpdir.mkdir("symlink").join("somefile")
f.write("content")
@ -21,6 +22,7 @@ def test_get_path_uid_symlink(tmpdir):
get_path_uid(fs)
@pytest.mark.skipif("not hasattr(os, 'O_NOFOLLOW')")
@pytest.mark.skipif("not hasattr(os, 'symlink')")
def test_get_path_uid_symlink_without_NOFOLLOW(tmpdir, monkeypatch):
monkeypatch.delattr("os.O_NOFOLLOW")
f = tmpdir.mkdir("symlink").join("somefile")