ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
535 stars 126 forks source link

.env not loaded #161

Closed ttecles closed 1 year ago

ttecles commented 2 years ago

I have Pycharm Professional 2021.2.3 but I added a .env file and I do not see any defined var in the environment

vanaoff commented 2 years ago

My suspicion is that it's somehow related with new test framework autodetect feature. If I run test with autodetect .env file is not respected. However if I create configuration specifically to pytest, it's working as expected.

Workaround is to go to Settings > Tools > Python Integrated Tools and set the test framework for module to some deterministic value.

ttecles commented 2 years ago

change it as you said and it is working. Problem related with autodetect feature.

avere001 commented 2 years ago

This worked after I recreated the pytest run configurations.