mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
Revert "Fix test database migration in makefile"
This reverts commit 7c4614b754
.
This commit is contained in:
parent
7c4614b754
commit
7e67434efd
2 changed files with 6 additions and 9 deletions
4
makefile
4
makefile
|
@ -38,8 +38,6 @@ clean-test: ## remove test and coverage artifacts
|
|||
rm -fr .pytest_cache
|
||||
|
||||
test: ## run tests quickly with the default Python
|
||||
export DB_URL=sqlite:///dev/data/test.db
|
||||
alembic upgrade head
|
||||
poetry run pytest
|
||||
|
||||
format:
|
||||
|
@ -85,4 +83,4 @@ coverage: ## check code coverage quickly with the default Python
|
|||
poetry run pytest
|
||||
coverage report -m
|
||||
coverage html
|
||||
$(BROWSER) htmlcov/index.html
|
||||
$(BROWSER) htmlcov/index.html
|
|
@ -25,16 +25,15 @@ engine = create_engine(
|
|||
connect_args={"check_same_thread": False},
|
||||
)
|
||||
|
||||
# alembic migrations (disabled as migrations happen in `make test`)
|
||||
# config = config.Config("alembic.ini")
|
||||
# config.set_main_option('sqlalchemy.url', DB_URL)
|
||||
# config.attributes['connection'] = engine
|
||||
# command.upgrade(config, "head")
|
||||
# alembic migrations
|
||||
config = config.Config("alembic.ini")
|
||||
config.set_main_option('sqlalchemy.url', DB_URL)
|
||||
config.attributes['connection'] = engine
|
||||
command.upgrade(config, "head")
|
||||
|
||||
# test session
|
||||
TestSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
|
||||
def override_get_db():
|
||||
try:
|
||||
db = TestSessionLocal()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue