From 5064fec46180852e7ec4026518e3ea53a2e2d893 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Tue, 5 Aug 2025 16:40:06 +0200 Subject: [PATCH] Update tests/test_utils_pv.py --- tests/test_utils_pv.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_utils_pv.py b/tests/test_utils_pv.py index 3a52a85d2..fb1a79ef7 100644 --- a/tests/test_utils_pv.py +++ b/tests/test_utils_pv.py @@ -26,18 +26,26 @@ def run_test_ioc(): prefix = "TEST:" ioc = TestIOC(prefix=prefix) + # ✅ Force minimal args to avoid pytest conflicts + _, run_options = ioc_arg_parser( + default_prefix=prefix, + desc="Test IOC", + argv=["--list-pvs"] # important to avoid argparse clash + ) + + # ✅ Proper IOC launch with run_options def start_ioc(): - # Run the IOC directly, no parsing - asyncio.run(run(ioc.pvdb, startup_hook=None)) + run(ioc.pvdb, **run_options) thread = threading.Thread(target=start_ioc, daemon=True) thread.start() - # Let the IOC boot up + # ✅ Wait for server to be up time.sleep(1.5) yield + # Fixture to capture stdout (for tqdm / progress bar) @pytest.fixture def capture_stdout(monkeypatch):