From ff8a90ec0068d7bdc85660ec73b1b837540a22c2 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Thu, 7 Aug 2025 14:41:32 +0200 Subject: [PATCH] Update tests/test_utils_pv.py --- tests/test_utils_pv.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_utils_pv.py b/tests/test_utils_pv.py index 65d967572..336a14967 100644 --- a/tests/test_utils_pv.py +++ b/tests/test_utils_pv.py @@ -63,6 +63,7 @@ def strip_ansi(text): def test_put_with_progress_and_repr(value, expected_color): pv = PV("TEST:VAL", connection_timeout=2.0) assert pv.wait_for_connection(timeout=2.0), "PV not connected" + pv.units = "//" pv.put(0.0, wait=True) assert pv.get() == pytest.approx(0.0) @@ -86,11 +87,11 @@ def test_put_with_progress_and_repr(value, expected_color): # Initialisation bar matches = [line for line in cleaned_lines if f"| |" in line] - assert matches, f"Expected bar '{expected_bar}' not found in:\n" + "\n".join(printed_lines) + assert matches, f"Expected bar not found in:\n" + "\n".join(printed_lines) # Vérifie que la bonne barre a été affichée au moins une fois matches = [line for line in cleaned_lines if f"|██████████████████████████████|" in line] - assert matches, f"Expected bar '{expected_bar}' not found in:\n" + "\n".join(printed_lines) + assert matches, f"Expected bar not found in:\n" + "\n".join(printed_lines) # Vérifie que la couleur est bien utilisée (au moins une fois dans les lignes printées) color_matches = [line for line in printed_lines if expected_color in line] @@ -100,7 +101,7 @@ def test_put_with_progress_and_repr(value, expected_color): assert pv.get() == pytest.approx(value) # Représentation - expected_repr = f'PV "TEST:VAL" at {value} units' + expected_repr = f'PV "TEST:VAL" at {value} //' assert repr(pv) == expected_repr assert pv.orig_repr().startswith('