-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make auto-loading .env
files optional with a setting to turn it off
#23575
Comments
Hi! To clarify is this primarily with tests you have this problem or with all parts of your setup? |
Yeah it mostly becomes a problem when I run tests, both from within the VS Code UI and through the integrated terminal. In both instances, they have the environment variables loaded but those variables mess up the tests. The |
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue. |
yes +1 to this, I was recently bitten by this. To me |
Agreed, this feature should either be optional or removed. This one bit me while working on a completely unrelated Node project. In my instance, I oftentimes switch between JS and Python, and I have extensions installed for both use cases. For my Node projects, I have multiple |
The Python extension looks for and loads the
.env
file within a workspace, which loads those variables into the environment for tests and the integrated terminal. This feature should be made optional with a setting to turn it off. The.env
file in a workspace often is not the settings someone would like to use when running unit tests, so tests will fail with those settings. Without a way to turn it off, I have to either comment out the.env
file before running unit tests, or go to another terminal outside of VS Code to run my tests.Please make the auto-loading of
.env
files in a workspace optional with a setting to turn it off.The text was updated successfully, but these errors were encountered: