mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Make sure that bzr is available when running under Travis.
This commit is contained in:
parent
eb7d4b2178
commit
bb385e2dbb
2 changed files with 21 additions and 1 deletions
|
@ -4,8 +4,20 @@ Contains functional tests of the Bazaar class.
|
|||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
from pip._internal.vcs.bazaar import Bazaar
|
||||
from tests.lib import _test_path_to_file_url, _vcs_add, create_file, need_bzr
|
||||
from tests.lib import (
|
||||
_test_path_to_file_url, _vcs_add, create_file, is_bzr_installed, need_bzr,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
'TRAVIS' not in os.environ,
|
||||
reason='Bazaar is only required under Travis')
|
||||
def test_ensure_bzr_available():
|
||||
"""Make sure that bzr is available when running in Travis."""
|
||||
assert is_bzr_installed()
|
||||
|
||||
|
||||
@need_bzr
|
||||
|
|
|
@ -801,6 +801,14 @@ def need_executable(name, check_cmd):
|
|||
return wrapper
|
||||
|
||||
|
||||
def is_bzr_installed():
|
||||
try:
|
||||
subprocess.check_output(('bzr', 'version', '--short'))
|
||||
except OSError:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def need_bzr(fn):
|
||||
return pytest.mark.bzr(need_executable(
|
||||
'Bazaar', ('bzr', 'version', '--short')
|
||||
|
|
Loading…
Reference in a new issue