From 0ec8d1ca3d866d7b44eadd454637bed5be836253 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff <35577657+nikhilwoodruff@users.noreply.github.com> Date: Tue, 23 Apr 2024 00:15:08 +0100 Subject: [PATCH] Adjust test passing conditions --- tests/test_basic_flat_file.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_basic_flat_file.py b/tests/test_basic_flat_file.py index d7629f7f..75bcf66c 100644 --- a/tests/test_basic_flat_file.py +++ b/tests/test_basic_flat_file.py @@ -73,6 +73,8 @@ def test_tc_variable_totals(variable): if tc_variable_totals[variable] == 0: # If the taxdata file has a zero total, we'll assume the PE file is still correct. return + # 20% and more than 10bn off taxdata is a failure. assert ( - abs(total / tc_variable_totals[variable] - 1) < 0.5 + abs(total / tc_variable_totals[variable] - 1) < 0.4 + or abs(total / 1e9 - tc_variable_totals[variable] / 1e9) < 30 ), f"{variable} ({name}) is off by {total / tc_variable_totals[variable] - 1:.1%} ({total/1e9:.1f}bn vs {tc_variable_totals[variable]/1e9:.1f}bn)"