Update tests/test_utils_pv.py
Run CI Tests / test (push) Successful in 1m10s

This commit is contained in:
2025-08-08 00:44:47 +02:00
parent d323e9987b
commit 33b2fe12a8
+17 -1
View File
@@ -151,4 +151,20 @@ def test_orig_repr_is_not_custom_repr():
# Check that the original repr looks like a real epics PV
assert original.startswith("<PV ")
assert "TEST:VAL" in original
assert "TEST:VAL" in original
def test_put_without_progress(capture_stdout):
pv = PV("TEST:VAL", connection_timeout=2.0)
assert pv.wait_for_connection(timeout=2.0), "PV not connected"
initial_value = pv.get()
new_value = initial_value + 10
# Capture stdout
stdout_before = capture_stdout.getvalue()
pv.put(new_value, show_progress=False)
stdout_after = capture_stdout.getvalue()
# Verify no output was produced
assert stdout_before == stdout_after, "Expected no output when show_progress=False"
assert pv.get() == pytest.approx(new_value)