13 ms·
I've dealt with problems from python-dotenv and very much prefer it as a command than as a library. As an example, once I changed a .env fikr and unit tests st
by pnt12 2y ago
I've dealt with problems from python-dotenv and very much prefer it as a command than as a library.
As an example, once I changed a .env fikr and unit tests started failing. Digging deeper into it, and lots of code was checking for .env to load its configurations, and would break without it. I'd prefer this not to happen, as our tests were executing based on outside, not version controlled, configurations.
After removing dotenv as a library and using it only as a command, we were able to separate configuration and logic, and not have .env files affecting our unit tests - we simply ran the application with dotenv command, and the unit tests without.