test_loader.py 文件源码

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

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

        suite = loader.loadTestsFromName('abc () //', unittest)
        error, test = self.check_deferred_error(loader, suite)
        self.check_module_lookup_error(
            error, test, 'unittest2', 'abc () //', 'abc \(\) //')

    # "The method optionally resolves name relative to the given module"
    #
    # Does loadTestsFromName raise TypeError when the `module` argument
    # isn't a module object?
    #
    # XXX Accepts the not-a-module object, ignoring the object's type
    # This should raise an exception or the method name should be changed
    #
    # XXX Some people are relying on this, so keep it for now
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号