Skip to content

Commit da0965f

Browse files
committed
minor cleanup
1 parent 5b47cc2 commit da0965f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clients/python/test/test_osparc/conftest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import json
1515
from tempfile import NamedTemporaryFile
1616
from pathlib import Path
17-
from typing import Any, Type, TypeVar
17+
from typing import Any, TypeVar
1818

1919

2020
@pytest.fixture
@@ -49,7 +49,7 @@ def dev_mode_enabled(monkeypatch: pytest.MonkeyPatch) -> None:
4949
@pytest.fixture
5050
def create_server_mock(
5151
mocker: MockerFixture,
52-
) -> Generator[Callable[[int, BaseModel], None], None, None]:
52+
) -> Callable[[int, BaseModel], None]:
5353
def _mock_server(_status: int, _body: BaseModel) -> None:
5454
def _sideeffect(
5555
method: str,
@@ -67,7 +67,7 @@ def _sideeffect(
6767

6868
mocker.patch("urllib3.PoolManager.request", side_effect=_sideeffect)
6969

70-
yield _mock_server
70+
return _mock_server
7171

7272

7373
T = TypeVar("T", bound=BaseModel)
@@ -76,13 +76,13 @@ def _sideeffect(
7676
@pytest.fixture
7777
def create_osparc_response_model(
7878
osparc_openapi_specs: dict[str, Any],
79-
) -> Generator[Callable[[Type[T]], T], None, None]:
80-
def _create_model(model_type: Type[T]) -> T:
79+
) -> Callable[[type[T]], T]:
80+
def _create_model(model_type: type[T]) -> T:
8181
schemas = osparc_openapi_specs.get("components", {}).get("schemas", {})
8282
example_data = schemas.get(model_type.__name__, {}).get("example", {})
8383
error_msg = "Could not extract example data for"
8484
error_msg += f" '{model_type.__name__}' from openapi specs"
8585
assert example_data, error_msg
8686
return model_type.model_validate(example_data)
8787

88-
yield _create_model
88+
return _create_model

0 commit comments

Comments
 (0)