@@ -63,61 +63,21 @@ describe("pip3 manager", function()
6363 it (
6464 " should exhaust python3 executable candidates if all fail" ,
6565 async_test (function ()
66- vim .g .python3_host_prog = " /my/python3"
6766 local handle = InstallHandleGenerator " dummy"
6867 local ctx = InstallContextGenerator (handle )
6968 ctx .spawn .python3 = spy .new (mockx .throws ())
7069 ctx .spawn .python = spy .new (mockx .throws ())
71- ctx .spawn [vim .g .python3_host_prog ] = spy .new (mockx .throws ())
7270 local err = assert .has_error (function ()
7371 installer .prepare_installer (ctx ):get_or_throw ()
7472 installer .exec_in_context (ctx , pip3 .packages { " package" })
7573 end )
76- vim .g .python3_host_prog = nil
7774
7875 assert .equals (" Unable to create python3 venv environment." , err )
79- assert .spy (ctx .spawn [" /my/python3" ]).was_called (1 )
8076 assert .spy (ctx .spawn .python3 ).was_called (1 )
8177 assert .spy (ctx .spawn .python ).was_called (1 )
8278 end )
8379 )
8480
85- it (
86- " should not exhaust python3 executable if one succeeds" ,
87- async_test (function ()
88- vim .g .python3_host_prog = " /my/python3"
89- local handle = InstallHandleGenerator " dummy"
90- local ctx = InstallContextGenerator (handle )
91- ctx .spawn .python3 = spy .new (mockx .throws ())
92- ctx .spawn .python = spy .new (mockx .returns {})
93- ctx .spawn [vim .g .python3_host_prog ] = spy .new (mockx .returns {})
94-
95- installer .prepare_installer (ctx ):get_or_throw ()
96- installer .exec_in_context (ctx , pip3 .packages { " package" })
97- vim .g .python3_host_prog = nil
98- assert .spy (ctx .spawn .python3 ).was_called (0 )
99- assert .spy (ctx .spawn .python ).was_called (1 )
100- assert .spy (ctx .spawn [" /my/python3" ]).was_called (1 )
101- end )
102- )
103-
104- it (
105- " should expand python3_host_prog path" ,
106- async_test (function ()
107- vim .g .python3_host_prog = " ~/python3"
108- local handle = InstallHandleGenerator " dummy"
109- local ctx = InstallContextGenerator (handle )
110- ctx .spawn .python = spy .new (mockx .returns {})
111- ctx .spawn [vim .env .HOME .. " /python3" ] = spy .new (mockx .returns {})
112-
113- installer .prepare_installer (ctx ):get_or_throw ()
114- installer .exec_in_context (ctx , pip3 .packages { " package" })
115- a .scheduler ()
116- vim .g .python3_host_prog = nil
117- assert .spy (ctx .spawn [vim .env .HOME .. " /python3" ]).was_called (1 )
118- end )
119- )
120-
12181 it (
12282 " should use install_args from settings" ,
12383 async_test (function ()
0 commit comments