From: Victor Stinner Date: Tue, 30 Jun 2015 15:06:30 +0000 (+0200) Subject: Fix Python 3 issues in Windows tests X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4055078083ee43aa79e713e6ec27440df388f3ea;p=openstack-build%2Fcinder-build.git Fix Python 3 issues in Windows tests * Replace __builtin__ with six.moves.builtins * tox.ini: add the following tests to Python 3.4 - cinder.tests.unit.windows.test_smbfs - cinder.tests.unit.windows.test_vhdutils - cinder.tests.unit.windows.test_windows - cinder.tests.unit.windows.test_windows_remotefs - cinder.tests.unit.windows.test_windows_utils This change requires the Python 3 fixes in os-brick. Blueprint cinder-python3 Change-Id: I1ffa65745923459e993e81d8a95a39e19c1bd1e4 --- diff --git a/cinder/tests/unit/windows/test_smbfs.py b/cinder/tests/unit/windows/test_smbfs.py index cb2c61982..b02bbf22a 100644 --- a/cinder/tests/unit/windows/test_smbfs.py +++ b/cinder/tests/unit/windows/test_smbfs.py @@ -55,7 +55,7 @@ class WindowsSmbFsTestCase(test.TestCase): mock.patch('sys.platform', 'win32').start() mock.patch.dict(sys.modules, ctypes=mock.DEFAULT).start() - mock.patch('__builtin__.wmi', create=True).start() + mock.patch('six.moves.builtins.wmi', create=True).start() self.addCleanup(mock.patch.stopall) diff --git a/tox.ini b/tox.ini index 5ee31eb48..dc91a71f5 100644 --- a/tox.ini +++ b/tox.ini @@ -99,7 +99,12 @@ commands = cinder.tests.unit.test_volume_types \ cinder.tests.unit.test_volume_types_extra_specs \ cinder.tests.unit.test_volume_utils \ - cinder.tests.unit.volume.flows.test_create_volume_flow + cinder.tests.unit.volume.flows.test_create_volume_flow \ + cinder.tests.unit.windows.test_smbfs \ + cinder.tests.unit.windows.test_vhdutils \ + cinder.tests.unit.windows.test_windows \ + cinder.tests.unit.windows.test_windows_remotefs \ + cinder.tests.unit.windows.test_windows_utils [testenv:pep8] commands =