]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix Python 3 issues in Windows tests
authorVictor Stinner <vstinner@redhat.com>
Tue, 30 Jun 2015 15:06:30 +0000 (17:06 +0200)
committerSean McGinnis <sean_mcginnis@dell.com>
Thu, 13 Aug 2015 13:43:40 +0000 (08:43 -0500)
* 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

cinder/tests/unit/windows/test_smbfs.py
tox.ini

index cb2c61982c74cf224245438b4e69dbed71d1841a..b02bbf22a19b67c0b34cfac0f76ece87caebebfb 100644 (file)
@@ -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 5ee31eb48a337deae207b8e6c947ee05a76a32db..dc91a71f5c54c0f0a117bd24a9594cbbbcdf82ca 100644 (file)
--- 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 =