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

[FEATURE] Allow env to be passed to lib.process.run #483

Closed
bendavis78 opened this issue Jan 9, 2025 · 2 comments
Closed

[FEATURE] Allow env to be passed to lib.process.run #483

bendavis78 opened this issue Jan 9, 2025 · 2 comments
Assignees

Comments

@bendavis78
Copy link

My test environment requires certain env vars to be set that are different from my neovim env. While the pytest runner allows me to pass --envfile to pytest, it is doesn't load the vars early enough (I need the env to be loaded in prior to loading project modules, not just the tests), so I need another way to set the env for the test process.

nvim.loop.spawn takes an env argument that allows you to pass environment variables. It would be helpful if env could be passed in via a configuration var at at this point.

For example:

  local opts = {
    adapters = {
      require("neotest-python")({
        dap = { justMyCode = false },
        env = { VAR1 = "foo", VAR2 = "bar"}
      }),
    },
  }
  
  require("neotest").setup(opts)
@bendavis78
Copy link
Author

Just realized this an issue w/ neotest-python, which should allow passing env into the adapter spec.

@bendavis78 bendavis78 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2025
@erichaus
Copy link

this would be nice as I wouldn't have to rely on using pytest-env

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

3 participants