EnvFile icon indicating copy to clipboard operation
EnvFile copied to clipboard

.env not loaded

Open ttecles opened this issue 2 years ago • 3 comments

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

ttecles avatar Nov 03 '21 13:11 ttecles

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.

vanaoff avatar Nov 11 '21 10:11 vanaoff

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

ttecles avatar Nov 15 '21 16:11 ttecles

This worked after I recreated the pytest run configurations.

avere001 avatar Dec 08 '21 23:12 avere001