test.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:enumap 作者: TadLeonard 项目源码 文件源码
def test_str_sparse_typed():
    """Make sure that EnumapMeta's __str___ method works with typed fields"""
    class Tools(SparseEnumap):
        head = default("your head")
        horse: float = default(3.14)
        donkey: int = auto()
        spatula = default(1)

    assert str(Tools) == "Tools(head = 'your head', horse: float = 3.14, donkey: int, spatula = 1)"  # noqa
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号