generalize skipping

- rename pytest_xfail to pytest_skip
- dynamic "skipif" and "xfail" decorators
- move most skipping code to the plugin

also coming with this commit:
- extend mark keyword to accept positional args + docs
- fix a few documentation related issues
- leave version as "trunk" for now

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-10-15 16:18:57 +02:00
parent 5e21e39125
commit 3ca770b420
28 changed files with 532 additions and 241 deletions

View File

@@ -208,7 +208,7 @@ class TestLocalPath(common.CommonFSTests):
assert l[2] == p3
class TestExecutionOnWindows:
disabled = py.std.sys.platform != 'win32'
skipif = "sys.platform != 'win32'"
def test_sysfind(self):
x = py.path.local.sysfind('cmd')
@@ -216,7 +216,7 @@ class TestExecutionOnWindows:
assert py.path.local.sysfind('jaksdkasldqwe') is None
class TestExecution:
disabled = py.std.sys.platform == 'win32'
skipif = "sys.platform == 'win32'"
def test_sysfind(self):
x = py.path.local.sysfind('test')
@@ -346,8 +346,7 @@ def test_homedir():
assert homedir.check(dir=1)
class TestWINLocalPath:
#root = local(TestLocalPath.root)
disabled = py.std.sys.platform != 'win32'
skipif = "sys.platform != 'win32'"
def test_owner_group_not_implemented(self):
py.test.raises(NotImplementedError, "path1.stat().owner")
@@ -396,7 +395,7 @@ class TestWINLocalPath:
old.chdir()
class TestPOSIXLocalPath:
disabled = py.std.sys.platform == 'win32'
skipif = "sys.platform == 'win32'"
def test_samefile(self, tmpdir):
assert tmpdir.samefile(tmpdir)

View File

@@ -50,12 +50,11 @@ class TestSvnURLCommandPath(CommonSvnTests):
def test_svnurl_characters_tilde_end(self, path1):
py.path.svnurl("http://host.com/some/file~")
@py.test.mark.xfail("sys.platform == 'win32'")
def test_svnurl_characters_colon_path(self, path1):
if py.std.sys.platform == 'win32':
# colons are allowed on win32, because they're part of the drive
# part of an absolute path... however, they shouldn't be allowed in
# other parts, I think
py.test.skip('XXX fixme win32')
# colons are allowed on win32, because they're part of the drive
# part of an absolute path... however, they shouldn't be allowed in
# other parts, I think
py.test.raises(ValueError, 'py.path.svnurl("http://host.com/foo:bar")')
def test_export(self, path1, tmpdir):