Update tests/test_utils_pv.py
Run CI Tests / test (push) Successful in 59s

This commit is contained in:
2025-08-07 14:53:24 +02:00
parent e643fbccaa
commit 14265efccd
+13 -3
View File
@@ -101,8 +101,6 @@ def test_put_with_progress_and_repr(value, expected_color):
# Représentation
expected_repr = f'PV "TEST:VAL" at {value} '
assert repr(pv) == expected_repr
assert pv.orig_repr().startswith('<epics.pv.PV')
def test_use_callback_context_manager():
pv = PV("TEST:VAL", connection_timeout=2.0)
@@ -122,4 +120,16 @@ def test_use_callback_context_manager():
time.sleep(0.2)
assert 42.0 in seen_values
assert len(pv._callbacks) == initial_count
assert len(pv._callbacks) == initial_count
def test_orig_repr_is_not_custom_repr():
pv = PV("TEST:VAL", connection_timeout=2.0)
custom = repr(pv)
original = pv.orig_repr()
# Check that the custom repr is not the same as the original
assert custom != original
# Check that the original repr looks like a real epics PV
assert original.startswith("<PV ")
assert "TEST:VAL" in original