Use SkipTest for skipping tests

This commit is contained in:
ZyX 2014-08-28 23:59:47 +04:00
parent 323f0c4e22
commit 70fabdc02b
1 changed files with 86 additions and 84 deletions

View File

@ -16,7 +16,7 @@ from powerline.lib.monotonic import monotonic
from powerline.lib.vcs.git import git_directory
from tests.lib import Pl
from tests import TestCase
from tests import TestCase, SkipTest
try:
@ -460,8 +460,9 @@ class TestVCS(TestCase):
os.remove(dotgit)
os.rename(spacegit, dotgit)
if use_mercurial:
def test_mercurial(self):
if not use_mercurial:
raise SkipTest('Mercurial is not available')
create_watcher = get_fallback_create_watcher()
repo = guess(path=HG_REPO, create_watcher=create_watcher)
self.assertNotEqual(repo, None)
@ -477,8 +478,9 @@ class TestVCS(TestCase):
self.assertEqual(repo.status('file'), 'A')
os.remove(os.path.join(HG_REPO, 'file'))
if use_bzr:
def test_bzr(self):
if not use_bzr:
raise SkipTest('Bazaar is not available')
create_watcher = get_fallback_create_watcher()
repo = guess(path=BZR_REPO, create_watcher=create_watcher)
self.assertNotEqual(repo, None, 'No bzr repo found. Do you have bzr installed?')