Skip to content

Commit 8e87aa9

Browse files
committed
Fix TestDiffUpdateMutation
1 parent bc4bc1e commit 8e87aa9

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

backend/tests/unit/graphql/diff/test_diff_update_mutation.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from infrahub.core.timestamp import Timestamp
99
from infrahub.database import InfrahubDatabase
1010
from infrahub.graphql.initialization import prepare_graphql_params
11-
from infrahub.services import InfrahubServices, services
11+
from infrahub.services import InfrahubServices
1212
from infrahub.services.adapters.workflow.local import WorkflowLocalExecution
1313
from tests.adapters.cache import MemoryCache
1414
from tests.adapters.message_bus import BusRecorder
@@ -38,16 +38,10 @@ class TestDiffUpdateMutation:
3838
diff_name = "CountDiffula"
3939

4040
@pytest.fixture
41-
def service_testing(self, db: InfrahubDatabase):
42-
original = services.service
43-
service = InfrahubServices(
41+
async def service_testing(self, db: InfrahubDatabase) -> InfrahubServices:
42+
return await InfrahubServices.new(
4443
database=db, message_bus=BusRecorder(), workflow=WorkflowLocalExecution(), cache=MemoryCache()
4544
)
46-
services.service = service
47-
services.prepare(service=services.service)
48-
yield service
49-
services.service = original
50-
services.prepare(service=services.service)
5145

5246
@pytest.fixture
5347
async def diff_branch(self, db: InfrahubDatabase) -> Branch:

0 commit comments

Comments
 (0)