Update tests/test_utils_hastyepics.py
Run CI Tests / test (push) Successful in 53s

This commit is contained in:
2025-08-03 19:57:46 +02:00
parent 4405fbdcc6
commit 23f1e695f0
+12 -12
View File
@@ -18,18 +18,18 @@ def test_motor_instantiation_fast_vs_epics():
with patch('epics.Motor.get') as mock_get, \
patch('epics.Motor.RTYP', new_callable=PropertyMock) as mock_rtyp:
# Mean of 10 runs
for _ in range(10):
t0 = time.perf_counter()
m_fast = Motor("TEST:MOTOR_t1")
t1 = time.perf_counter()
t2 = time.perf_counter()
m_slow = epics.Motor("TEST:MOTOR_t2")
t3 = time.perf_counter()
fast_times.append(t1 - t0)
slow_times.append(t3 - t2)
# Mean of 10 runs
for _ in range(10):
t0 = time.perf_counter()
m_fast = Motor("TEST:MOTOR_t1")
t1 = time.perf_counter()
t2 = time.perf_counter()
m_slow = epics.Motor("TEST:MOTOR_t2")
t3 = time.perf_counter()
fast_times.append(t1 - t0)
slow_times.append(t3 - t2)
avg_fast = sum(fast_times) / len(fast_times)
avg_slow = sum(slow_times) / len(slow_times)