Fixed wrong import path

This commit is contained in:
2025-12-05 15:50:35 +01:00
parent 9a4d101b0d
commit b2f282e8bb

View File

@@ -20,7 +20,7 @@ from pathlib import Path
import time
from tests.conftest import check_ioc_running
from setup.classes import IocNotRunning
from src.classes import IocNotRunning
# Time we excpect the IOC needs to start up
TIMEOUT_IOC_STARTUP = 10
@@ -36,12 +36,12 @@ 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("*"):
if pa.is_dir() and "__pycache__" not in pa.parts:
# Ignore all axis paths which start with an underscore
if pa.is_dir() and "__pycache__" not in pa.parts:
# Ignore all axis paths which start with an underscore
if not pa.parts[-1].startswith("_"):
folders.append(pa)
@@ -64,9 +64,9 @@ except IocNotRunning:
print('Starting IOC ...')
# Start the IOC as a separate process, wait a bit and try again
path = Path(__file__).resolve().parent / 'ioc' / 'startioc'
p = subprocess.Popen([path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
p = subprocess.Popen([path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
now = time.time()
while now + TIMEOUT_IOC_STARTUP > time.time():
time.sleep(0.5)
@@ -75,7 +75,8 @@ except IocNotRunning:
except IocNotRunning:
pass
check_ioc_running()
print(f'Started IOC successfully (process ID {p.pid}). It will automatically terminate after all tests are done.')
print(
f'Started IOC successfully (process ID {p.pid}). It will automatically terminate after all tests are done.')
# Run each enabled folder's relevant tests in parallel
processes = []
@@ -90,4 +91,4 @@ for proc in processes:
code = proc.wait()
if code != 0:
exit_code = code
sys.exit(exit_code)
sys.exit(exit_code)