Import alembic.command as alembic_cmd
This commit is contained in:
parent
e9743eaa01
commit
dc45c689c4
2 changed files with 3 additions and 2 deletions
|
|
@ -544,6 +544,7 @@ banned-from = [
|
||||||
|
|
||||||
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
||||||
|
|
||||||
|
"alembic.command" = "alembic_cmd"
|
||||||
"click.core" = "cli_core"
|
"click.core" = "cli_core"
|
||||||
"click.testing" = "cli_testing"
|
"click.testing" = "cli_testing"
|
||||||
"collections.abc" = "cabc"
|
"collections.abc" = "cabc"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from alembic import command as migrations_cmd
|
from alembic import command as alembic_cmd
|
||||||
from alembic import config as migrations_config
|
from alembic import config as migrations_config
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
|
|
||||||
|
|
@ -60,7 +60,7 @@ def db_connection(request):
|
||||||
db.Base.metadata.create_all(connection)
|
db.Base.metadata.create_all(connection)
|
||||||
else:
|
else:
|
||||||
cfg = migrations_config.Config("alembic.ini")
|
cfg = migrations_config.Config("alembic.ini")
|
||||||
migrations_cmd.upgrade(cfg, "head")
|
alembic_cmd.upgrade(cfg, "head")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
yield connection
|
yield connection
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue