This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user