Skip to content

Commit

Permalink
Fix pytest defs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelldls committed Nov 12, 2024
1 parent 83b92e9 commit 27035d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/backends/graphQL/test_graphQL.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

import pytest
from fastapi.testclient import TestClient
from pytest_mock import MockerFixture
from tests.conftest import AssertableController

from fastcs.attributes import AttrR
from fastcs.backends.graphQL.backend import GraphQLBackend
Expand Down Expand Up @@ -54,8 +52,8 @@ def nest_responce(path: list[str], value: Any) -> dict:

class TestGraphQLServer:
@pytest.fixture(autouse=True)
def setup_tests(self, mocker: MockerFixture):
self.controller = AssertableController(mocker)
def setup_tests(self, assertable_controller):
self.controller = assertable_controller
app = GraphQLBackend(self.controller)._server._app
self.client = TestClient(app)

Expand Down
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ def controller():
return TestController()


@pytest.fixture
def assertable_controller(mocker):
return AssertableController(mocker)


@pytest.fixture
def mapping(controller):
return Mapping(controller)
Expand Down

0 comments on commit 27035d9

Please sign in to comment.