This commit is contained in:
+13
-10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user