Skip to content

Commit

Permalink
fix(backend, tests): remove duplicate wrong bad fixtures
Browse files Browse the repository at this point in the history
Signed-off-by: Fatih Acar <[email protected]>
  • Loading branch information
fatih-acar committed Jan 20, 2025
1 parent 6e9a872 commit 5faefe8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
7 changes: 0 additions & 7 deletions backend/tests/unit/api/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pendulum
import pytest
from fastapi.testclient import TestClient
from prefect.testing.utilities import prefect_test_harness

from infrahub import config
from infrahub.core.constants import InfrahubKind
Expand Down Expand Up @@ -31,12 +30,6 @@ def admin_headers():
return {"X-INFRAHUB-KEY": "admin-security"}


@pytest.fixture(autouse=True, scope="session")
def prefect_test_fixture():
with prefect_test_harness():
yield


@pytest.fixture
def rpc_bus(helper):
original = config.OVERRIDE.message_bus
Expand Down
9 changes: 1 addition & 8 deletions backend/tests/unit/graphql/queries/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from prefect.artifacts import ArtifactRequest
from prefect.client.orchestration import PrefectClient, get_client
from prefect.states import State
from prefect.testing.utilities import prefect_test_harness

from infrahub.core.branch import Branch
from infrahub.core.constants import InfrahubKind
Expand Down Expand Up @@ -86,12 +85,6 @@
"""


@pytest.fixture
def local_prefect_server():
with prefect_test_harness():
yield


@pytest.fixture
async def tag_blue(db: InfrahubDatabase, default_branch: Branch) -> Node:
blue = await Node.init(db=db, schema=InfrahubKind.TAG, branch=default_branch)
Expand Down Expand Up @@ -125,7 +118,7 @@ async def account_bill(db: InfrahubDatabase, default_branch: Branch) -> Node:


@pytest.fixture
async def prefect_client(local_prefect_server):
async def prefect_client(prefect_test_fixture):
async with get_client(sync_client=False) as client:
yield client

Expand Down

0 comments on commit 5faefe8

Please sign in to comment.