From cde1eb84bd1813ff4425fe6f05cbdeba8e410c13 Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Thu, 15 Jan 2015 23:25:04 +0100 Subject: Use unittest.mock from standard library instead of external mock with Python >=3.3. --- setuptools/tests/test_msvc9compiler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'setuptools/tests/test_msvc9compiler.py') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index a0820fff..e54e7a6e 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -7,7 +7,10 @@ import contextlib import distutils.errors import pytest -import mock +try: + from unittest import mock +except ImportError: + import mock from . import contexts -- cgit v1.2.1 From 3558c1a03584064e9bb86d3886009902eec6832d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Jan 2015 19:53:25 -0500 Subject: Have mock_install_dir actually yield the file name. Ref #317. --- setuptools/tests/test_msvc9compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/tests/test_msvc9compiler.py') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index e54e7a6e..82c4d521 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -173,4 +173,4 @@ class TestModulePatch: vcvarsall = os.path.join(result, 'vcvarsall.bat') with open(vcvarsall, 'w'): pass - yield + yield vcvarsall -- cgit v1.2.1 From 903de3abdd20a96051cedad2f0f4287a3a4b11b5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Jan 2015 20:48:10 -0500 Subject: Just the path is expected --- setuptools/tests/test_msvc9compiler.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'setuptools/tests/test_msvc9compiler.py') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 82c4d521..0790e3d2 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -113,7 +113,8 @@ class TestModulePatch: Ensure user's settings are preferred. """ result = distutils.msvc9compiler.find_vcvarsall(9.0) - assert user_preferred_setting == result + expected = os.path.join(user_preferred_setting, 'vcvarsall.bat') + assert expected == result @pytest.yield_fixture def local_machine_setting(self): @@ -134,7 +135,8 @@ class TestModulePatch: Ensure machine setting is honored if user settings are not present. """ result = distutils.msvc9compiler.find_vcvarsall(9.0) - assert local_machine_setting == result + expected = os.path.join(local_machine_setting, 'vcvarsall.bat') + assert expected == result @pytest.yield_fixture def x64_preferred_setting(self): @@ -160,7 +162,8 @@ class TestModulePatch: Ensure 64-bit system key is preferred. """ result = distutils.msvc9compiler.find_vcvarsall(9.0) - assert x64_preferred_setting == result + expected = os.path.join(x64_preferred_setting, 'vcvarsall.bat') + assert expected == result @staticmethod @contextlib.contextmanager @@ -173,4 +176,4 @@ class TestModulePatch: vcvarsall = os.path.join(result, 'vcvarsall.bat') with open(vcvarsall, 'w'): pass - yield vcvarsall + yield result -- cgit v1.2.1 From 21ebac859dff95cb593180f7fffdf74d8a5e5275 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 15 Jan 2015 21:09:57 -0500 Subject: Fix failing test by reverting to author's original intent. Ref #317 --- setuptools/tests/test_msvc9compiler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools/tests/test_msvc9compiler.py') diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py index 0790e3d2..09e0460c 100644 --- a/setuptools/tests/test_msvc9compiler.py +++ b/setuptools/tests/test_msvc9compiler.py @@ -142,7 +142,7 @@ class TestModulePatch: def x64_preferred_setting(self): """ Set up environment with 64-bit and 32-bit system settings configured - and yield the 64-bit location. + and yield the canonical location. """ with self.mock_install_dir() as x32_dir: with self.mock_install_dir() as x64_dir: @@ -155,7 +155,7 @@ class TestModulePatch: }, ) with reg: - yield x64_dir + yield x32_dir def test_ensure_64_bit_preferred(self, x64_preferred_setting): """ -- cgit v1.2.1