codeflash-internal/codeflash/verification/verification_utils.py

12 lines
434 B
Python

import os
import pickle
import re
def get_test_file_path(test_dir, function_name, iteration=0, test_type="unit"):
assert test_type in ["unit", "inspired", "replay"]
function_name = function_name.replace(".", "_")
path = os.path.join(test_dir, f"test_{function_name}__{test_type}_test_{iteration}.py")
if os.path.exists(path):
return get_test_file_path(test_dir, function_name, iteration + 1)
return path