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

This commit is contained in:
2025-08-07 15:06:50 +02:00
parent b4a61a11eb
commit 1c5686b72e
+4 -4
View File
@@ -60,12 +60,12 @@ def strip_ansi(text):
(-50.0, 150.0, colorama.Fore.GREEN)
])
def test_put_with_progress_and_repr(value_new, value_old, expected_color):
def test_put_with_progress_and_repr(value_new, value_before, expected_color):
pv = PV("TEST:VAL", connection_timeout=2.0)
assert pv.wait_for_connection(timeout=2.0), "PV not connected"
pv.put(value_before, wait=True)
assert pv.get() == value before
assert pv.get() == value_before
# Capture tous les prints dans une liste
printed_lines = []
@@ -78,7 +78,7 @@ def test_put_with_progress_and_repr(value_new, value_old, expected_color):
original_print = builtins.print
builtins.print = fake_print
try:
pv.put(value, show_progress=True)
pv.put(value_new, show_progress=True)
finally:
builtins.print = original_print
@@ -96,7 +96,7 @@ def test_put_with_progress_and_repr(value_new, value_old, expected_color):
color_matches = [line for line in printed_lines if expected_color in line]
assert color_matches, "Expected color code not found"
assert value_new and value_old in printed_lines
assert value_new and value_before in printed_lines
# Vérifie que la valeur finale est correcte
assert pv.get() == pytest.approx(value)