Skip to content

Commit

Permalink
Drop procrastinate stuff before using the migrator
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack authored Jun 30, 2024
1 parent eafe386 commit b7ed719
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions adit_radis_shared/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import time
from typing import Callable, Generator
from typing import Callable

import pytest
from django.db import connection
Expand Down Expand Up @@ -66,11 +66,9 @@ def _create_and_login_user(server_url: str):


@pytest.fixture
def migrator_ext(migrator: Migrator) -> Generator[Migrator, None, None]:
yield migrator

# We have to manually cleanup the Procrastinate tables, functions and types
# as otherwise the reset of django_test_migrations will fail
def migrator_ext(migrator: Migrator) -> Migrator:
# We have to manually drop the Procrastinate tables, functions and types
# as otherwise django_test_migrations will fail.
# See https://github.com/procrastinate-org/procrastinate/issues/1090
with connection.cursor() as cursor:
cursor.execute("""
Expand Down Expand Up @@ -108,3 +106,5 @@ def migrator_ext(migrator: Migrator) -> Generator[Migrator, None, None]:
);
END $$;
""")

return migrator

0 comments on commit b7ed719

Please sign in to comment.