Closed alessio-izzo closed 5 years ago
I don't think it's related to the plugin - maybe some of the env vars you set break it?
Yes. I found out that the problem occurs when setting the PYTHONPATH variable. If I set PYTHONPATH into the file, the error is raised.
Glad you was able to figure it out! 😊
But there is a right way to set PYTHONPATH into the .env file? I mean, have you ever tried setting the pythonpath variable? If I set it in the usual way, I don't have problems.
You'd want to add a value to it rather than overwrite it altogether (as PyCharm manipulates it inject its helpers). For instance, if there is a dir src
within your project that you want to add you can do it like this:
PYTHONPATH=src:${PYTHONPATH}
Also, don't forget to enable env var substitution as seen below:
P.S.: Please note that env var substitution is not a standard feature of env file format and is unlikely to work with anything else besides EnvFile plugin.
Hi, I recently had an issue running any test with pytest where the env variables where set by an .env file. This is the error message given by pycharm:
These are my settings: PyCharm 2019.1.3 (Community Edition) Build #PC-191.7479.30, built on May 29, 2019 JRE: 11.0.2+9-b159.60 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.14.5 The EnvFile version is 3.2.0 If I uncheck the use of the .env file, the tests run correctly.