@@ -51,21 +51,31 @@ def test_isolated_environment_install(mocker):
5151 ]
5252
5353
54+ @pytest .mark .skipif (IS_PY2 , reason = 'venv module used on Python 3 only' )
55+ @pytest .mark .skipif (sys .platform != 'darwin' , reason = 'workaround for Apple Python' )
56+ def test_can_get_venv_paths_with_conflicting_default_scheme (mocker ):
57+ mocker .patch .object (build .env , 'virtualenv' , None )
58+ get_scheme_names = mocker .patch ('sysconfig.get_scheme_names' , return_value = ('osx_framework_library' ,))
59+ with build .env .IsolatedEnvBuilder ():
60+ pass
61+ assert get_scheme_names .call_count == 1
62+
63+
5464@pytest .mark .skipif (IS_PY2 , reason = 'venv module used on Python 3 only' )
5565@pytest .mark .skipif (IS_PYPY3 , reason = 'PyPy3 uses get path to create and provision venv' )
5666def test_executable_missing_post_creation (mocker ):
5767 mocker .patch .object (build .env , 'virtualenv' , None )
58- original_get_path = sysconfig .get_path
68+ original_get_paths = sysconfig .get_paths
5969
60- def _get_path ( name , vars ): # noqa
70+ def _get_paths ( vars ): # noqa
6171 shutil .rmtree (vars ['base' ])
62- return original_get_path ( name , vars = vars )
72+ return original_get_paths ( vars = vars )
6373
64- get_path = mocker .patch ('sysconfig.get_path ' , side_effect = _get_path )
74+ get_paths = mocker .patch ('sysconfig.get_paths ' , side_effect = _get_paths )
6575 with pytest .raises (RuntimeError , match = 'Virtual environment creation failed, executable .* missing' ):
6676 with build .env .IsolatedEnvBuilder ():
6777 pass
68- assert get_path .call_count == 1
78+ assert get_paths .call_count == 1
6979
7080
7181def test_isolated_env_abstract ():
0 commit comments