Full mypy --strict type checking pass

This commit is contained in:
Martijn Pieters
2023-05-09 17:08:32 +01:00
parent e92604802e
commit 941cd044c7
10 changed files with 693 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import Any, Optional, Tuple
from typing import Any, Optional, Tuple, Type
import pytest
from pydantic import BaseModel, ValidationError
@@ -53,7 +53,7 @@ def test_pickle_coder(value: Any) -> None:
(PDItem(name="foo", price=42.0, description="some pydantic item", tax=0.2), PDItem),
],
)
def test_json_coder(value: Any, return_type) -> None:
def test_json_coder(value: Any, return_type: Type[Any]) -> None:
encoded_value = JsonCoder.encode(value)
assert isinstance(encoded_value, bytes)
decoded_value = JsonCoder.decode_as_type(encoded_value, type_=return_type)