def test_repr_sparse_typed():
"""Make sure that SparseEnumapMeta's __repr___ method works
with typed fields
"""
class Tools(SparseEnumap):
head = default("your head")
horse: float = default(3.14)
donkey: int = auto()
spatula = 100 # this isn't a default
# None defaults are not explicitly shown for readability
assert repr(Tools) == """Tools(
head = 'your head',
horse: float = 3.14,
donkey: int,
spatula
)"""
评论列表
文章目录