diff --git a/tests/test_mlserver.py b/tests/test_mlserver.py index 934c9bb6..7c70ee0a 100644 --- a/tests/test_mlserver.py +++ b/tests/test_mlserver.py @@ -2,9 +2,9 @@ from inspect import iscoroutine import pytest +from mlserver.codecs import NumpyCodec from mlserver.settings import ModelSettings from mlserver.types import InferenceRequest, RequestInput -from mlserver.codecs import NumpyCodec from pytest_cases import fixture, parametrize_with_cases from pytest_cases.common_pytest_lazy_values import is_lazy @@ -16,11 +16,7 @@ @pytest.fixture def inference_request() -> InferenceRequest: - return InferenceRequest( - inputs=[ - RequestInput(name="payload", shape=[4], data=[1, 2, 3, 4], datatype="FP32") - ] - ) + return InferenceRequest(inputs=[RequestInput(name="payload", shape=[4], data=[1, 2, 3, 4], datatype="FP32")]) @fixture @@ -44,9 +40,7 @@ async def test_load(mlserver_runtime: InferenceRuntime): assert isinstance(mlserver_runtime._model, BaseModel) -async def test_predict( - mlserver_runtime: InferenceRuntime, inference_request: InferenceRequest -): +async def test_predict(mlserver_runtime: InferenceRuntime, inference_request: InferenceRequest): # NOTE: pytest-cases doesn't wait for async fixtures # TODO: Raise issue in pytest-cases repo mlserver_runtime = await mlserver_runtime @@ -68,9 +62,7 @@ async def test_predict( assert expected_output.tolist() == pipeline_output.__root__ -async def test_load_wrapped_class( - inference_pipeline_class, inference_request: InferenceRequest -): +async def test_load_wrapped_class(inference_pipeline_class, inference_request: InferenceRequest): codec = NumpyCodec() pipeline_input = codec.decode(inference_request.inputs[0])