diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2018-11-21 17:45:50 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2018-11-21 17:45:50 +0100 |
commit | 61077f3fa478a5329ddd4acb12212d1241de4b10 (patch) | |
tree | 264efd0f16ad7eb24c64d4081c766ab0cdfc90b9 /simple_unit_tests.py | |
parent | e988ffeb676a959725df2b3b971ff0dbb998f573 (diff) | |
download | pyparsing-git-61077f3fa478a5329ddd4acb12212d1241de4b10.tar.gz |
Fix failing tests (both py2K and py3k)
Fixes #48
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} ), ] |