From e726e89ea1a49ad41f4f8ce868a4ff13dca9ad12 Mon Sep 17 00:00:00 2001 From: Jonathan Green Date: Wed, 1 May 2024 19:38:06 -0300 Subject: [PATCH] Use fixture --- tests/migration/test_instance_init_script.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/migration/test_instance_init_script.py b/tests/migration/test_instance_init_script.py index 234dca3cce..fb5546373b 100644 --- a/tests/migration/test_instance_init_script.py +++ b/tests/migration/test_instance_init_script.py @@ -15,7 +15,7 @@ from palace.manager.core.config import Configuration from palace.manager.scripts import InstanceInitializationScript from palace.manager.sqlalchemy.session import SessionManager -from tests.fixtures.database import DatabaseFixture, DatabaseNameFixture +from tests.fixtures.database import DatabaseFixture from tests.fixtures.services import ServicesFixture, mock_services_container @@ -84,10 +84,11 @@ def _run_script(config_path: Path, worker_url: str) -> None: def test_locking( alembic_runner: MigrationContext, alembic_config_path: Path, - database_name_func: DatabaseNameFixture, + instance_init_script_fixture: InstanceInitScriptFixture, ) -> None: # Migrate to the initial revision alembic_runner.migrate_down_to("base") + worker_url = instance_init_script_fixture.database.database_name.worker_url # Spawn three processes, that will all try to migrate to head # at the same time. One of them should do the migration, and @@ -95,7 +96,7 @@ def test_locking( # has already been done. process_kwargs = { "config_path": alembic_config_path, - "worker_url": database_name_func.worker_url, + "worker_url": worker_url, } p1 = Process(target=_run_script, kwargs=process_kwargs) p2 = Process(target=_run_script, kwargs=process_kwargs)