diff options
Diffstat (limited to 'yardstick/tests/functional/common/test_packages.py')
-rw-r--r-- | yardstick/tests/functional/common/test_packages.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/yardstick/tests/functional/common/test_packages.py b/yardstick/tests/functional/common/test_packages.py index 5dead4e55..e15f72898 100644 --- a/yardstick/tests/functional/common/test_packages.py +++ b/yardstick/tests/functional/common/test_packages.py @@ -15,6 +15,7 @@ import os from os import path import re +import unittest from yardstick.common import packages from yardstick.common import utils @@ -39,16 +40,21 @@ class PipPackagesTestCase(base.BaseFunctionalTestCase): utils.execute_command('sudo rm -rf %s' % self.TMP_FOLDER) def _remove_package(self, package): - os.system('%s pip uninstall %s -y' % (self.PYTHONPATH, package)) + os.system('%s python -m pip uninstall %s -y' % + (self.PYTHONPATH, package)) def _list_packages(self): pip_list_regex = re.compile( r"(?P<name>[\w\.-]+) \((?P<version>[\w\d_\.\-]+),*.*\)") + pip_list_regex_18 = re.compile( + r"(?P<name>[\w\.-]+)[\s]+(?P<version>[\w\d_\.\-]+),*.*") pkg_dict = {} - pkgs = utils.execute_command('pip list', + pkgs = utils.execute_command('python -m pip list', env={'PYTHONPATH': self.TMP_FOLDER}) for line in pkgs: match = pip_list_regex.match(line) + if not match: + match = pip_list_regex_18.match(line) if match and match.group('name'): pkg_dict[match.group('name')] = match.group('version') return pkg_dict @@ -64,6 +70,7 @@ class PipPackagesTestCase(base.BaseFunctionalTestCase): self.assertEqual(0, packages.pip_install(package_dir, self.TMP_FOLDER)) self.assertTrue(package_name in self._list_packages()) + @unittest.skip("see https://github.com/pypa/pip/issues/3889") def test_install_from_pip_package(self): dirname = path.dirname(__file__) package_path = (dirname + @@ -84,11 +91,10 @@ class PipPackagesTestCase(base.BaseFunctionalTestCase): # NOTE (ralonsoh): from requirements.txt file. The best way to test # this function is to parse requirements.txt and test-requirements.txt # and check all packages. - pkgs_ref = {'Babel': '2.3.4', - 'SQLAlchemy': '1.1.12', - 'influxdb': '4.1.1', - 'netifaces': '0.10.6', - 'unicodecsv': '0.14.1'} + pkgs_ref = {'Babel': '2.6.0', + 'SQLAlchemy': '1.2.18', + 'influxdb': '5.1.0', + 'netifaces': '0.10.9'} pkgs = packages.pip_list() for name, version in (pkgs_ref.items()): self.assertEqual(version, pkgs[name]) |