__main__.py 文件源码

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

项目:lazyutils 作者: fabiommendes 项目源码 文件源码
def main(args=None):
    """
    Called with ``python -m lazyutils.tests``: run main test suite.
    """

    parser = get_parser()
    args = parser.parse_args(args)

    # Check if pytest is available
    try:
        import pytest
    except ImportError:
        raise SystemExit(
            'You need py.test to run the test suite.\n'
            'You can install it using your distribution package manager or\n'
            '    $ python -m pip install pytest --user'
        )

    # Get data from test_module
    import lazyutils.tests as test_module
    test_path = os.path.abspath(os.path.dirname(test_module.__file__))
    pytest.main([test_path, '-m', 'not documentation'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号