Update tests/test_utils_hastepics.py
Run CI Tests / test (push) Successful in 2m32s

This commit is contained in:
2025-08-11 11:39:02 +02:00
parent 63364a8264
commit c3efdae867
+8 -5
View File
@@ -122,19 +122,22 @@ def test_motor_val_connect_via_cache():
assert pv is not None
assert not pv.connected
assert pv.connect(timeout=2.0), "VAL did not connect"
assert pv.wait_for_connection(timeout=2.0)
pv.put(123.0, wait=True)
assert pv.get(timeout=1.0) == 123.0
def test_speedup_get_pv():
"""Ton get_pv délègue à epics.get_pv : on vérifie juste qu'il n'est pas nettement plus lent."""
N = 10
t0 = time.perf_counter()
get_pv("TEST:SIM:M13.VAL", connect=False)
for _ in range(N):
get_pv("TEST:SIM:M13.VAL", connect=False)
t1 = time.perf_counter()
t2 = time.perf_counter()
epics.get_pv("TEST:SIM:M13.VAL", connect=True)
for _ in range(N):
epics.get_pv("TEST:SIM:M13.VAL", connect=True)
t3 = time.perf_counter()
fast_time = t1 - t0
@@ -147,11 +150,11 @@ def test_speedup_get_pv():
def test_speedup_motor_instantiation():
"""On exige juste pas de grosse régression vs EPICS."""
t0 = time.perf_counter()
Motor("TEST:SIM:M2")
Motor("TEST:SIM:M6")
t1 = time.perf_counter()
t2 = time.perf_counter()
epics.Motor("TEST:SIM:M3")
epics.Motor("TEST:SIM:M8")
t3 = time.perf_counter()
fast_time = t1 - t0