From 436b5dacd938c72b15bcfd5563341e46144f2f34 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 20 Jan 2024 17:20:21 -0800 Subject: [PATCH] test_power_draw: check msgs expect first for cleaner error old-commit-hash: e0d0896dcfbab482e10ef90794c746497b359321 --- system/hardware/tici/tests/test_power_draw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/hardware/tici/tests/test_power_draw.py b/system/hardware/tici/tests/test_power_draw.py index c61d67e79d..337bbc9974 100755 --- a/system/hardware/tici/tests/test_power_draw.py +++ b/system/hardware/tici/tests/test_power_draw.py @@ -91,8 +91,8 @@ class TestPowerDraw(unittest.TestCase): msgs_expected = int(sum(SAMPLE_TIME * SERVICE_LIST[msg].frequency for msg in proc.msgs)) tab.append([proc.name, round(expected, 2), round(cur, 2), msgs_expected, msgs_received]) with self.subTest(proc=proc.name): - np.testing.assert_allclose(cur, expected, rtol=proc.rtol, atol=proc.atol) np.testing.assert_allclose(msgs_expected, msgs_received, rtol=.02, atol=2) + np.testing.assert_allclose(cur, expected, rtol=proc.rtol, atol=proc.atol) print(tabulate(tab)) print(f"Baseline {baseline:.2f}W\n")