blurb.py 文件源码

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

项目:core-workflow 作者: python 项目源码 文件源码
def test(*args):
    """
Run unit tests.  Only works inside source repo, not when installed.
    """
    # unittest.main doesn't work because this isn't a module
    # so we'll do it ourselves

    print("-" * 79)

    for clsname, cls in sorted(globals().items()):
        if clsname.startswith("Test") and isinstance(cls, type):
            o = cls()
            for fnname in sorted(dir(o)):
                if fnname.startswith("test"):
                    fn = getattr(o, fnname)
                    if callable(fn):
                        fn()
    print()
    print(tests_run, "tests passed.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号