You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Configurations for different environments all existed in the
user_service.config.config module. Python will execute this file
from top to bottom, regardless of the configs (and environment) in use.
- This brought along "cross contamination" between environments. For
example, when in the test environment, TestConfig is used and the value
for SQLALCHEMY_DATABASE_URI is a hardcoded string that points to sqlite3
memory database, so there is no need to set the SQLALCHEMY_DATABASE_URI
environment variable, right?
- Wrong. DevConfig which previously existed in the same module as
TestConfig was fetching its value for SQLALCHEMY_DATABASE_URI from an
environment variable, but because this has not been set for the test
environment the tests would fail with a KeyError
(from os.environ['SQLALCHEMY_DATABASE_URI']).
- The tests were failing because of an environment variable that is not
needed.
- Splitting the configurations into different modules should fix this
issue.
0 commit comments