Skip to content

Commit

Permalink
Avoid calling db.init_app twice
Browse files Browse the repository at this point in the history
  • Loading branch information
bcollazo committed Mar 19, 2023
1 parent e0081ae commit 9614ee4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion catanatron_server/catanatron_server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def create_app(test_config=None):
# ===== Initialize Database
from catanatron_server.models import db

db.init_app(app)
with app.app_context():
db.init_app(app)
db.create_all()

# ===== Initialize Routes
Expand Down
5 changes: 0 additions & 5 deletions tests/integration_tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ def app():
# create the app with common test config
app = create_app({"TESTING": True, "SQLALCHEMY_DATABASE_URI": "sqlite:///:memory:"})

# create the database and load test data
with app.app_context():
db.init_app(app)
db.create_all()

yield app


Expand Down

0 comments on commit 9614ee4

Please sign in to comment.