@@ -11,7 +11,7 @@ import marshmallow
|
|||||||
|
|
||||||
|
|
||||||
DataSub = typing.TypeVar("DataSub", bound="BaseData")
|
DataSub = typing.TypeVar("DataSub", bound="BaseData")
|
||||||
DataDict = typing.NewType("DataDict", dict[str, object])
|
DataDict = typing.TypeVar("DataDict")
|
||||||
|
|
||||||
|
|
||||||
class DataMeta(type):
|
class DataMeta(type):
|
||||||
@@ -45,9 +45,12 @@ class DataMeta(type):
|
|||||||
for name, type_ in cls.__annotations__.items()
|
for name, type_ in cls.__annotations__.items()
|
||||||
if name != "id"
|
if name != "id"
|
||||||
}
|
}
|
||||||
return typing.TypedDict( # type: ignore [no-any-return,operator]
|
return typing.cast(
|
||||||
f"{cls.__name__}Dict",
|
DataDict,
|
||||||
fields,
|
typing.TypedDict( # type: ignore [operator]
|
||||||
|
f"{cls.__name__}Dict",
|
||||||
|
fields,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
"""Tests for validating the Settings object."""
|
"""Tests for validating the Settings object."""
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import random
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ def example_settings() -> settings.Settings:
|
|||||||
return settings.Settings(
|
return settings.Settings(
|
||||||
creds=settings.CredentialSettings(
|
creds=settings.CredentialSettings(
|
||||||
baseurl="http://nowhere.huh",
|
baseurl="http://nowhere.huh",
|
||||||
token="Fake Token", # noqa: S106
|
token=str(random.randint(0, 1000000)),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user