Skip to content

Commit

Permalink
feat(tests): don't overwrite custom configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
Psycojoker committed Jul 24, 2024
1 parent 77fc08a commit dc97ae0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ def mock_config(mocker) -> Config:

config_file_path: Path = Path.cwd() / "config.yml"

# The postgres/redis hosts use Docker network names in the default config.
# We always use localhost for tests.
config.postgres.host.value = "127.0.0.1"
config.redis.host.value = "127.0.0.1"

if config_file_path.exists():
user_config_raw: str = config_file_path.read_text()

# Little trick to allow empty config files
if user_config_raw:
config.yaml.loads(user_config_raw)

# The postgres/redis hosts use Docker network names in the default config.
# We always use localhost for tests.
config.postgres.host.value = "127.0.0.1"
config.redis.host.value = "127.0.0.1"

# To test handle_new_storage
config.storage.store_files.value = True

Expand Down

0 comments on commit dc97ae0

Please sign in to comment.