From e6a9a730900bb919c87a4e23700799ed1843c120 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Tue, 5 Aug 2025 17:18:43 +0200 Subject: [PATCH] Update tests/test_utils_pv.py --- tests/test_utils_pv.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/test_utils_pv.py b/tests/test_utils_pv.py index 513996e59..c55a262da 100644 --- a/tests/test_utils_pv.py +++ b/tests/test_utils_pv.py @@ -9,7 +9,7 @@ import colorama from slic.utils.pv import PV # Caproto is used to simulate a real EPICS IOC for testing from caproto.server import pvproperty, PVGroup, ioc_arg_parser, run - +import caproto.server as cs # IOC definition: a single PV TEST:VAL with units class TestIOC(PVGroup): @@ -25,21 +25,24 @@ def run_test_ioc(): prefix = "TEST:" ioc = TestIOC(prefix=prefix) - # Avoid parsing pytest args - _, run_options = ioc_arg_parser( - default_prefix=prefix, - desc="Test IOC", - argv=["--prefix", prefix, "--verbose"] + # Manually construct run_options to avoid argparse issues + run_options = cs.RunOptions( + prefix=prefix, + interfaces=["127.0.0.1"], + log_pv_names=True, + startup_hook=None, + async_lib='asyncio', + simulate=False, + macros={} ) + print("✅ Starting IOC with prefix", prefix) ioc.start(run_options) - print("✅ IOC started with PVs:", list(ioc.pvdb.keys())) - time.sleep(1) + import time + time.sleep(1) # give some time to start up yield - # Optional: shutdown logic if needed - # Fixture to capture stdout (for tqdm / progress bar)