mirror of
https://github.com/powerline/powerline.git
synced 2025-07-16 10:24:58 +02:00
Use SkipTest for skipping tests
This commit is contained in:
parent
323f0c4e22
commit
70fabdc02b
@ -16,7 +16,7 @@ from powerline.lib.monotonic import monotonic
|
|||||||
from powerline.lib.vcs.git import git_directory
|
from powerline.lib.vcs.git import git_directory
|
||||||
|
|
||||||
from tests.lib import Pl
|
from tests.lib import Pl
|
||||||
from tests import TestCase
|
from tests import TestCase, SkipTest
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -460,8 +460,9 @@ class TestVCS(TestCase):
|
|||||||
os.remove(dotgit)
|
os.remove(dotgit)
|
||||||
os.rename(spacegit, dotgit)
|
os.rename(spacegit, dotgit)
|
||||||
|
|
||||||
if use_mercurial:
|
|
||||||
def test_mercurial(self):
|
def test_mercurial(self):
|
||||||
|
if not use_mercurial:
|
||||||
|
raise SkipTest('Mercurial is not available')
|
||||||
create_watcher = get_fallback_create_watcher()
|
create_watcher = get_fallback_create_watcher()
|
||||||
repo = guess(path=HG_REPO, create_watcher=create_watcher)
|
repo = guess(path=HG_REPO, create_watcher=create_watcher)
|
||||||
self.assertNotEqual(repo, None)
|
self.assertNotEqual(repo, None)
|
||||||
@ -477,8 +478,9 @@ class TestVCS(TestCase):
|
|||||||
self.assertEqual(repo.status('file'), 'A')
|
self.assertEqual(repo.status('file'), 'A')
|
||||||
os.remove(os.path.join(HG_REPO, 'file'))
|
os.remove(os.path.join(HG_REPO, 'file'))
|
||||||
|
|
||||||
if use_bzr:
|
|
||||||
def test_bzr(self):
|
def test_bzr(self):
|
||||||
|
if not use_bzr:
|
||||||
|
raise SkipTest('Bazaar is not available')
|
||||||
create_watcher = get_fallback_create_watcher()
|
create_watcher = get_fallback_create_watcher()
|
||||||
repo = guess(path=BZR_REPO, create_watcher=create_watcher)
|
repo = guess(path=BZR_REPO, create_watcher=create_watcher)
|
||||||
self.assertNotEqual(repo, None, 'No bzr repo found. Do you have bzr installed?')
|
self.assertNotEqual(repo, None, 'No bzr repo found. Do you have bzr installed?')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user