loader.py 文件源码

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

项目:QTAF 作者: Tencent 项目源码 文件源码
def _load_from_package(self, pkg ):
        '''???python???????

        :param pkg: Python?
        :type pkg: ModuleType
        :returns list - ????????
        '''
        tests = []
        for _, modulename, ispkg in pkgutil.walk_packages(pkg.__path__, pkg.__name__+'.', onerror=self._walk_package_error):
            if ispkg:
                continue
            try:
                __import__(modulename)
                tests += self._load_from_module(sys.modules[modulename])
            except:
                self._module_errs[modulename] = traceback.format_exc()
        return tests
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号