run_all.py 507 B

1234567891011121314151617181920
  1. from os import path
  2. import os
  3. here_dir = path.dirname(path.abspath(__file__))
  4. def run_all_test():
  5. """顺序运行所有测试用例"""
  6. files = [f for f in os.listdir(here_dir) if path.isfile(f) and f.split('.', 1)[0].isdigit()]
  7. files.sort(key=lambda f: int(f.split('.', 1)[0]))
  8. for f in files:
  9. file = path.join(here_dir, f)
  10. print("Run test script: %s" % file)
  11. os.system("npx percy exec -- python3 %s auto" % file)
  12. if __name__ == '__main__':
  13. run_all_test()