Skip to content

Commit

Permalink
Fix tests that fail when run outside Docker (#122)
Browse files Browse the repository at this point in the history
## Changes
- Include db_client fixture which sets DB-related environment variables
  that aren't set by default when running outside the container

## Context
Outside the container the environment variables from local.env aren't
automatically set which caused some db tests to fail. This PR includes
the db_client fixture that sets those environment variables.
  • Loading branch information
lorenyu authored Feb 3, 2023
1 parent 6e22fae commit 802779e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@
import api.logging
import tests.api.db.models.factories as factories
from api.db import models
from api.util.local import load_local_env_vars
from tests.lib import db_testing

logger = logging.getLogger(__name__)


@pytest.fixture(autouse=True)
def env_vars():
load_local_env_vars()


####################
# Test DB session
####################
Expand Down

0 comments on commit 802779e

Please sign in to comment.