Commits

holger krekel committed 41c0618

prevent test from running if path supports no symlinks

  • Participants
  • Parent commits d1d2322

Comments (0)

Files changed (1)

testing/test_rsync.py

+import pytest
 import py
 from execnet import RSync
 import execnet
     )
 pytest_funcarg__gw2 = pytest_funcarg__gw1
 
+needssymlink = pytest.mark.skipif(not hasattr(py.path.local, "mksymlinkto"),
+                                  reason="py.path.local has no mksymlinkto() on this platform")
+
 def pytest_funcarg__dirs(request):
     t = request.getfuncargvalue('tmpdir')
     class dirs:
         mode = destdir.stat().mode
         assert mode & 511 == 504
 
-    @py.test.mark.skipif("not hasattr(os, 'symlink')")
+    @needssymlink
     def test_symlink_rsync(self, dirs, gw1):
         source = dirs.source
         dest = dirs.dest1
         assert dest.join('rellink').readlink() == "subdir/existant"
         assert dest.join('abslink').readlink() == expected
 
-    @py.test.mark.skipif("not hasattr(os, 'symlink')")
+    @needssymlink
     def test_symlink2_rsync(self, dirs, gw1):
         source = dirs.source
         dest = dirs.dest1