Added tests for new EL734 driver

This commit is contained in:
Stefan Mathis
2025-11-03 16:31:18 +01:00
parent 7ab4486748
commit 9cab5b82d9
22 changed files with 293 additions and 88 deletions

View File

@@ -36,7 +36,7 @@ for arg in sys.argv[1:]:
extra_args.append(arg)
# Find all axes paths (pa) within all controller paths (pc)
folders =[]
folders = []
for pc in Path("tests").glob("*"):
if pc.is_dir() and "__pycache__" not in pc.parts:
for pa in Path(pc).glob("*"):
@@ -51,9 +51,12 @@ if not path_args:
enabled_folders = folders
else:
for folder in folders:
if any(Path(arg).resolve().as_posix().startswith(Path(folder).resolve().as_posix()) for arg in path_args):
if any(Path(folder).resolve().as_posix().startswith(Path(arg).resolve().as_posix()) for arg in path_args):
enabled_folders.append(folder)
if not enabled_folders:
print(f"No tests were found within the specified path {path_args}")
# Check if the IOC is running and try to start it, if it isn't
try:
check_ioc_running()
@@ -77,14 +80,7 @@ except IocNotRunning:
# Run each enabled folder's relevant tests in parallel
processes = []
for folder in enabled_folders:
folder_path_args = (
[arg for arg in path_args if Path(arg).resolve().as_posix().startswith(Path(folder).resolve().as_posix())]
if path_args else [folder.as_posix()]
)
command = ["pytest"] + folder_path_args + extra_args
print(f"Running: {' '.join(command)}")
command = ["pytest"] + [str(folder)] + extra_args
proc = subprocess.Popen(command)
processes.append(proc)