aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2024-01-21 18:47:59 +0100
committerGitHub <noreply@github.com>2024-01-21 18:47:59 +0100
commitbce96d2fd483e71826728c6f9ac721fc9dd7d2cf (patch)
treef5e819529129791740c855c47c1b0675c15bfd63 /tests
parentfix(ui): don't indent empty lines (#1597) (diff)
downloadmason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar
mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.gz
mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.bz2
mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.lz
mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.xz
mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.tar.zst
mason-bce96d2fd483e71826728c6f9ac721fc9dd7d2cf.zip
feat: don't use vim.g.python3_host_prog as a candidate for python (#1606)
This is inconsistent with how other system dependencies are resolved and is not documented anywhere.
Diffstat (limited to 'tests')
-rw-r--r--tests/mason-core/managers/pip3_spec.lua40
1 files changed, 0 insertions, 40 deletions
diff --git a/tests/mason-core/managers/pip3_spec.lua b/tests/mason-core/managers/pip3_spec.lua
index cf7aff9b..9ad8e1d8 100644
--- a/tests/mason-core/managers/pip3_spec.lua
+++ b/tests/mason-core/managers/pip3_spec.lua
@@ -63,62 +63,22 @@ describe("pip3 manager", function()
it(
"should exhaust python3 executable candidates if all fail",
async_test(function()
- vim.g.python3_host_prog = "/my/python3"
local handle = InstallHandleGenerator "dummy"
local ctx = InstallContextGenerator(handle)
ctx.spawn.python3 = spy.new(mockx.throws())
ctx.spawn.python = spy.new(mockx.throws())
- ctx.spawn[vim.g.python3_host_prog] = spy.new(mockx.throws())
local err = assert.has_error(function()
installer.prepare_installer(ctx):get_or_throw()
installer.exec_in_context(ctx, pip3.packages { "package" })
end)
- vim.g.python3_host_prog = nil
assert.equals("Unable to create python3 venv environment.", err)
- assert.spy(ctx.spawn["/my/python3"]).was_called(1)
assert.spy(ctx.spawn.python3).was_called(1)
assert.spy(ctx.spawn.python).was_called(1)
end)
)
it(
- "should not exhaust python3 executable if one succeeds",
- async_test(function()
- vim.g.python3_host_prog = "/my/python3"
- local handle = InstallHandleGenerator "dummy"
- local ctx = InstallContextGenerator(handle)
- ctx.spawn.python3 = spy.new(mockx.throws())
- ctx.spawn.python = spy.new(mockx.returns {})
- ctx.spawn[vim.g.python3_host_prog] = spy.new(mockx.returns {})
-
- installer.prepare_installer(ctx):get_or_throw()
- installer.exec_in_context(ctx, pip3.packages { "package" })
- vim.g.python3_host_prog = nil
- assert.spy(ctx.spawn.python3).was_called(0)
- assert.spy(ctx.spawn.python).was_called(1)
- assert.spy(ctx.spawn["/my/python3"]).was_called(1)
- end)
- )
-
- it(
- "should expand python3_host_prog path",
- async_test(function()
- vim.g.python3_host_prog = "~/python3"
- local handle = InstallHandleGenerator "dummy"
- local ctx = InstallContextGenerator(handle)
- ctx.spawn.python = spy.new(mockx.returns {})
- ctx.spawn[vim.env.HOME .. "/python3"] = spy.new(mockx.returns {})
-
- installer.prepare_installer(ctx):get_or_throw()
- installer.exec_in_context(ctx, pip3.packages { "package" })
- a.scheduler()
- vim.g.python3_host_prog = nil
- assert.spy(ctx.spawn[vim.env.HOME .. "/python3"]).was_called(1)
- end)
- )
-
- it(
"should use install_args from settings",
async_test(function()
settings.set {