EnvFile
EnvFile copied to clipboard
.env not loaded
I have Pycharm Professional 2021.2.3 but I added a .env file and I do not see any defined var in the environment
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.
change it as you said and it is working. Problem related with autodetect feature.
This worked after I recreated the pytest run configurations.