@@ -51,34 +51,6 @@ 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 (IS_PYPY3 , reason = 'PyPy3 uses get path to create and provision venv' )
56- def test_fail_to_get_script_path (mocker ):
57- mocker .patch .object (build .env , 'virtualenv' , None )
58- get_path = mocker .patch ('sysconfig.get_path' , return_value = None )
59- with pytest .raises (RuntimeError , match = "Couldn't get environment scripts path" ):
60- env = build .env .IsolatedEnvBuilder ()
61- with env :
62- pass
63- assert not os .path .exists (env ._path )
64- assert get_path .call_count == 1
65-
66-
67- @pytest .mark .skipif (IS_PY2 , reason = 'venv module used on Python 3 only' )
68- @pytest .mark .skipif (IS_PYPY3 , reason = 'PyPy3 uses get path to create and provision venv' )
69- def test_fail_to_get_purepath (mocker ):
70- mocker .patch .object (build .env , 'virtualenv' , None )
71- sysconfig_get_path = sysconfig .get_path
72- mocker .patch (
73- 'sysconfig.get_path' ,
74- side_effect = lambda path , * args , ** kwargs : '' if path == 'purelib' else sysconfig_get_path (path , * args , ** kwargs ),
75- )
76-
77- with pytest .raises (RuntimeError , match = "Couldn't get environment purelib folder" ):
78- with build .env .IsolatedEnvBuilder ():
79- pass
80-
81-
8254@pytest .mark .skipif (IS_PY2 , reason = 'venv module used on Python 3 only' )
8355@pytest .mark .skipif (IS_PYPY3 , reason = 'PyPy3 uses get path to create and provision venv' )
8456def test_executable_missing_post_creation (mocker ):
0 commit comments