aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_msvc9compiler.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-09-26 18:14:44 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-09-26 18:14:44 -0400
commit2d58fe235143f63f56e1207ab51e8ea6df1bb04d (patch)
treedbb7a4e902486cf8baee307536f8966346895ac1 /setuptools/tests/test_msvc9compiler.py
parent84376ed5bb61c4a8a25048c83ad8d9fa60618db5 (diff)
downloadexternal_python_setuptools-2d58fe235143f63f56e1207ab51e8ea6df1bb04d.tar.gz
external_python_setuptools-2d58fe235143f63f56e1207ab51e8ea6df1bb04d.tar.bz2
external_python_setuptools-2d58fe235143f63f56e1207ab51e8ea6df1bb04d.zip
Remove excess whitespace
--HG-- extra : amend_source : b8e14d29b2a36b84e30e22cf231d0b1730eeb7f4
Diffstat (limited to 'setuptools/tests/test_msvc9compiler.py')
-rw-r--r--setuptools/tests/test_msvc9compiler.py26
1 files changed, 12 insertions, 14 deletions
diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py
index 272e99e8..33dca836 100644
--- a/setuptools/tests/test_msvc9compiler.py
+++ b/setuptools/tests/test_msvc9compiler.py
@@ -27,20 +27,20 @@ class MockReg:
with an instance of this class that mocks out the
functions that access the registry.
"""
-
+
def __init__(self, hkey_local_machine={}, hkey_current_user={}):
self.hklm = hkey_local_machine
self.hkcu = hkey_current_user
-
+
def __enter__(self):
self.original_read_keys = distutils.msvc9compiler.Reg.read_keys
self.original_read_values = distutils.msvc9compiler.Reg.read_values
-
+
hives = {
HKEY_CURRENT_USER: self.hkcu,
HKEY_LOCAL_MACHINE: self.hklm,
}
-
+
def read_keys(cls, base, key):
"""Return list of registry keys."""
hive = hives.get(base, {})
@@ -52,12 +52,12 @@ class MockReg:
hive = hives.get(base, {})
return dict((k.rpartition('\\')[2], hive[k])
for k in hive if k.startswith(key.lower()))
-
+
distutils.msvc9compiler.Reg.read_keys = classmethod(read_keys)
distutils.msvc9compiler.Reg.read_values = classmethod(read_values)
-
+
return self
-
+
def __exit__(self, exc_type, exc_value, exc_tb):
distutils.msvc9compiler.Reg.read_keys = self.original_read_keys
distutils.msvc9compiler.Reg.read_values = self.original_read_values
@@ -80,7 +80,7 @@ class TestMSVC9Compiler(unittest.TestCase):
try:
with MockReg():
self.assertIsNone(find_vcvarsall(9.0))
-
+
try:
query_vcvarsall(9.0)
self.fail('Expected DistutilsPlatformError from query_vcvarsall()')
@@ -90,10 +90,10 @@ class TestMSVC9Compiler(unittest.TestCase):
finally:
if old_value:
os.environ["VS90COMNTOOLS"] = old_value
-
+
key_32 = r'software\microsoft\devdiv\vcforpython\9.0\installdir'
key_64 = r'software\wow6432node\microsoft\devdiv\vcforpython\9.0\installdir'
-
+
# Make two mock files so we can tell whether HCKU entries are
# preferred to HKLM entries.
mock_installdir_1 = tempfile.mkdtemp()
@@ -105,7 +105,7 @@ class TestMSVC9Compiler(unittest.TestCase):
try:
# Ensure we get the current user's setting first
with MockReg(
- hkey_current_user={ key_32: mock_installdir_1 },
+ hkey_current_user={key_32: mock_installdir_1},
hkey_local_machine={
key_32: mock_installdir_2,
key_64: mock_installdir_2,
@@ -114,7 +114,7 @@ class TestMSVC9Compiler(unittest.TestCase):
self.assertEqual(mock_vcvarsall_bat_1, find_vcvarsall(9.0))
# Ensure we get the local machine value if it's there
- with MockReg(hkey_local_machine={ key_32: mock_installdir_2 }):
+ with MockReg(hkey_local_machine={key_32: mock_installdir_2}):
self.assertEqual(mock_vcvarsall_bat_2, find_vcvarsall(9.0))
# Ensure we prefer the 64-bit local machine key
@@ -131,5 +131,3 @@ class TestMSVC9Compiler(unittest.TestCase):
finally:
shutil.rmtree(mock_installdir_1)
shutil.rmtree(mock_installdir_2)
-
- \ No newline at end of file