Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing additional test arguments to runner #400

Closed
robamu opened this issue Apr 28, 2024 · 1 comment
Closed

Passing additional test arguments to runner #400

robamu opened this issue Apr 28, 2024 · 1 comment
Assignees

Comments

@robamu
Copy link

robamu commented Apr 28, 2024

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 robamu changed the title Passing test arguments to runner Passing additional test arguments to runner Apr 28, 2024
@robamu
Copy link
Author

robamu commented Apr 28, 2024

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

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

@robamu robamu closed this as completed Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants