diff --git a/makefile b/makefile index 762c55462..8b010e68a 100644 --- a/makefile +++ b/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 \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index b922d17d1..9c2bc779a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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()