def test_loadTestsFromNames__empty_name(self):
loader = unittest2.TestLoader()
try:
loader.loadTestsFromNames([''])
except ValueError:
e = sys.exc_info()[1]
self.assertEqual(str(e), "Empty module name")
else:
self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
# "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."
#
# What happens when presented with an impossible module name?
test_loader.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录