消失的 unittest.makeSuite()

  过去都是用 

    suite = unittest.makeSuite(HelloTestCase)

  建立完整的TestSuite。

  

  升级到Python3后,发现makeSuite没有啦!其实是被下面这段代码取代了。

    suite=unittest.TestLoader().loadTestsFromTestCase(HelloTestCase)

    (备注: TestLoader uses the 'test' method name prefix to identify test methods automatically.)

  

  Python啊,善变啊。

原文地址:https://www.cnblogs.com/pyblogs/p/2421398.html