test_environ_config.py 文件源码

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

项目:environ_config 作者: hynek 项目源码 文件源码
def test_tolerates_attribs(self):
        """
        Classes are allowed to have plain attr.ibs for e.g.
        __attrs_post_init__.
        """
        @environ.config
        class Cfg(object):
            e = environ.var()
            x = attr.ib(default=42)

        cfg = environ.to_config(Cfg, environ={
            "APP_E": "e",
        })

        assert Cfg("e", 42) == cfg
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号