过去都是用 

    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啊,善变啊。

相关文章:

  • 2022-12-23
  • 2021-07-28
  • 2021-04-08
猜你喜欢
  • 2021-11-06
  • 2022-02-26
  • 2022-03-03
  • 2022-12-23
  • 2021-05-31
  • 2022-01-21
  • 2021-12-20
相关资源
相似解决方案