Skip to content

Commit

Permalink
Fix db url in envvar test
Browse files Browse the repository at this point in the history
  • Loading branch information
jerith committed Jul 13, 2023
1 parent 21a5ddc commit ac0de61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def read_test_data(path: str) -> str:
class Database:
engine: Engine

@property
def url_with_password(self):
return self.engine.url.render_as_string(hide_password=False)

@contextmanager
def session(self, **kw) -> Generator[Session, None, None]:
kw.setdefault("expire_on_commit", False)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_sync_faqmatches_envvars(runner, fake_data_export, db, monkeypatch):

assert db.fetch_faqs() == []

monkeypatch.setenv("AAQ_SYNC_DB_URL", str(db.engine.url))
monkeypatch.setenv("AAQ_SYNC_DB_URL", db.engine.url_with_password)
monkeypatch.setenv("AAQ_SYNC_EXPORT_URL", str(fake_data_export.base_url))
monkeypatch.setenv("AAQ_SYNC_EXPORT_TOKEN", "faketoken")
monkeypatch.setenv("AAQ_SYNC_TABLES", "faqmatches")
Expand Down

0 comments on commit ac0de61

Please sign in to comment.