diff options
Diffstat (limited to 'simple_unit_tests.py')
-rw-r--r-- | simple_unit_tests.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/simple_unit_tests.py b/simple_unit_tests.py index 13278fb..f21b0f2 100644 --- a/simple_unit_tests.py +++ b/simple_unit_tests.py @@ -282,10 +282,11 @@ class TestParseAction(PyparsingExpressionTestCase): class TestResultsModifyingParseAction(PyparsingExpressionTestCase): def compute_stats_parse_action(t): - # by the time this parse action is called, parsed numeric words have been converted to ints - # by a previous parse action, so they can be treated as ints + # by the time this parse action is called, parsed numeric words + # have been converted to ints by a previous parse action, so + # they can be treated as ints t['sum'] = sum(t) - t['ave'] = sum(t) / len(t) + t['ave'] = sum(t) // len(t) t['min'] = min(t) t['max'] = max(t) @@ -295,7 +296,7 @@ class TestResultsModifyingParseAction(PyparsingExpressionTestCase): expr = pp.OneOrMore(pp.pyparsing_common.integer).addParseAction(compute_stats_parse_action), text = "27 1 14 22 89", expected_list = [27, 1, 14, 22, 89], - expected_dict = {'ave': 30.6, 'max': 89, 'min': 1, 'sum': 153} + expected_dict = {'ave': 30, 'max': 89, 'min': 1, 'sum': 153} ), ] |