refine skipif to use direct booleans, to help with flakes

This commit is contained in:
holger krekel 2014-01-29 11:46:36 +01:00
parent 4eabfed651
commit 2b8a54d5d9
2 changed files with 5 additions and 2 deletions

View File

@ -177,7 +177,8 @@ class TestGeneralUsage:
assert result.ret != 0
assert "should be seen" in result.stdout.str()
@pytest.mark.skipif("not hasattr(py.path.local, 'mksymlinkto')")
@pytest.mark.skipif(not hasattr(py.path.local, 'mksymlinkto'),
reason="symlink not available on this platform")
def test_chdir(self, testdir):
testdir.tmpdir.join("py").mksymlinkto(py._pydir)
p = testdir.tmpdir.join("main.py")

View File

@ -1,3 +1,4 @@
import py
import pytest
from _pytest.tmpdir import tmpdir, TempdirHandler
@ -71,7 +72,8 @@ def test_basetemp(testdir):
assert result.ret == 0
assert mytemp.join('hello').check()
@pytest.mark.skipif("not hasattr(py.path.local, 'mksymlinkto')")
@pytest.mark.skipif(not hasattr(py.path.local, 'mksymlinkto'),
reason="symlink not available on this platform")
def test_tmpdir_always_is_realpath(testdir):
# the reason why tmpdir should be a realpath is that
# when you cd to it and do "os.getcwd()" you will anyway