nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.12k stars 105 forks source link

Passing additional test arguments to runner #400

Closed robamu closed 2 months ago

robamu commented 2 months ago

I might just be doing a simple thing wrong and I am not sure whether this is related to neotest-python or neotest itself.

I am trying to pass an additional argument to the test runner.

Having the following in my neovim config does work:

local nt = require("neotest")
nt.setup({
  adapters = {
    require("neotest-python")({
      args = { "-s" },
    }),
    require("neotest-rust"),
  },
})

However, I only want to allow/have this on a case-by-case basis, so I tried the following in the neovim terminal

:lua require("neotest").run.run({args={"-s"}})

That does not seem to work. Maybe the arguments are not forwarded to the runner somehow?

Kind Regards Robin

robamu commented 2 months ago

Ah, I figured out the argument needs to be called extra_args. The following works:

:lua require("neotest").run.run({extra_args={"-s"}})