for case in case_name:
        mod = importlib.import_module('tests.'+case)#动态导入tests目录下的case
        clas = getattr(mod, case)#实例化case
        atts = dir(clas)#获得case属性
        for att in atts:
            if 'test_' in att:
                print('%s running......' % att)
                test = getattr(clas(), att)()#运行含有‘test_’的方法
                print('%s is complete' % att)

 

相关文章:

  • 2021-12-20
  • 2022-12-23
  • 2021-07-21
  • 2021-05-28
  • 2021-10-20
  • 2022-12-23
  • 2022-01-17
  • 2021-05-05
猜你喜欢
  • 2021-06-05
  • 2021-12-01
  • 2021-06-06
  • 2021-07-19
  • 2021-07-30
  • 2021-07-25
相关资源
相似解决方案