File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ def _wrap_command(
124124 method : Callable , controller : BaseController
125125) -> Callable [..., Awaitable [None ]]:
126126 async def command () -> None :
127- await method . __get__ (controller )()
127+ await getattr (controller , method . __name__ )()
128128
129129 return command
130130
Original file line number Diff line number Diff line change 55import pytest
66from fastapi .testclient import TestClient
77from pytest_mock import MockerFixture
8- from tests .conftest import AssertableController
98
109from fastcs .attributes import AttrR
1110from fastcs .backends .rest .backend import RestBackend
@@ -20,8 +19,8 @@ def pascal_2_snake(input: list[str]) -> list[str]:
2019
2120class TestRestServer :
2221 @pytest .fixture (autouse = True )
23- def setup_tests (self , mocker : MockerFixture ):
24- self .controller = AssertableController ( mocker )
22+ def setup_tests (self , assertable_controller ):
23+ self .controller = assertable_controller
2524 app = RestBackend (self .controller )._server ._app
2625 self .client = TestClient (app )
2726
Original file line number Diff line number Diff line change @@ -143,6 +143,11 @@ def controller():
143143 return TestController ()
144144
145145
146+ @pytest .fixture
147+ def assertable_controller (mocker ):
148+ return AssertableController (mocker )
149+
150+
146151@pytest .fixture
147152def mapping (controller ):
148153 return Mapping (controller )
You can’t perform that action at this time.
0 commit comments