Skip to content

Commit

Permalink
fix alembic configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Wojciech Sadowy <wojciech.sadowy@freedomfi.com>
  • Loading branch information
Wojciech Sadowy committed Apr 29, 2022
1 parent f07646e commit 1f07635
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions dp/cloud/python/magma/db_service/migrations/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ prepend_sys_path = .
# are written from script.py.mako
# output_encoding = utf-8

sqlalchemy.url = ''


[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
Expand Down
2 changes: 1 addition & 1 deletion dp/cloud/python/magma/db_service/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# can be acquired:
# ... etc.

db_url = config.get_section("alembic")["sqlalchemy.url"]
db_url = config.get_section("alembic").get("sqlalchemy.url")

if not db_url:
db_service_cfg = get_config()
Expand Down
2 changes: 1 addition & 1 deletion dp/cloud/python/magma/db_service/tests/alembic_testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def close_session(self):
def drop_all(self):
self.metadata.drop_all()

def assert_tables_equal(self, tables=None):
def then_tables_are(self, tables=None):
if tables is None:
tables = []
self.reflect_tables()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_b0cad5321c88_upgrade(self):
self.upgrade()

# then
self.assert_tables_equal(self.tables)
self.then_tables_are(self.tables)

def test_b0cad5321c88_downgrade(self):
# given
Expand All @@ -35,4 +35,4 @@ def test_b0cad5321c88_downgrade(self):
self.downgrade()

# then
self.assert_tables_equal()
self.then_tables_are()

0 comments on commit 1f07635

Please sign in to comment.