chemelli74

Check slow HA tests

Nov 25th, 2021
531
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """Check slow HA test"""
  2. import os
  3. import sys
  4.  
  5. path = sys.argv[1]
  6.  
  7. directory_contents: list[str] = os.listdir(path)
  8. directory_contents.sort()
  9. for item in directory_contents:
  10.     itempath = f"{path}/{item}"
  11.     if os.path.isdir(itempath) and "__" not in item:
  12.         print(f"running tests in {itempath}")
  13.         stream = os.popen(f"pytest {itempath} --durations-min=1 --durations=0")
  14.         for line in stream.readlines():
  15.             if "::" in line:
  16.                 print(line)
  17.  
RAW Paste Data