test_loader.py 文件源码

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

项目:devsecops-example-helloworld 作者: boozallen 项目源码 文件源码
def test_loadTestsFromNames__unknown_attr_name(self):
        loader = unittest.TestLoader()

        suite = loader.loadTestsFromNames(
            ['unittest2.loader.sdasfasfasdf', 'unittest2.test.dummy'])
        error, test = self.check_deferred_error(loader, list(suite)[0])
        self.check_module_lookup_error(error, test, 'unittest2.loader')

    # "The specifier name is a ``dotted name'' that may resolve either to
    # a module, a test case class, a TestSuite instance, a test method
    # within a test case class, or a callable object which returns a
    # TestCase or TestSuite instance."
    # ...
    # "The method optionally resolves name relative to the given module"
    #
    # What happens when given an unknown attribute on a specified `module`
    # argument?
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号