1import glob 2import os 3import shutil 4import subprocess 5from pathlib import Path 6 7test_nim_dir = Path(__file__).absolute().parent 8test_dir = test_nim_dir.parent 9 10 11def main(): 12 try: 13 subprocess.check_call("testament --megatest:off all".split()) 14 finally: 15 shutil.rmtree(test_nim_dir / "nimcache") 16 shutil.rmtree(test_nim_dir / "testresults") 17 for f in glob.glob(str(test_nim_dir / "tests" / "*" / "test")): 18 os.remove(f) 19 20 21if __name__ == "__main__": 22 main() 23