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
test_loader.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录