diff options
-rw-r--r-- | examples/antlr_grammar_tests.py | 4 | ||||
-rw-r--r-- | examples/test_bibparse.py | 4 | ||||
-rw-r--r-- | simple_unit_tests.py | 9 |
3 files changed, 9 insertions, 8 deletions
diff --git a/examples/antlr_grammar_tests.py b/examples/antlr_grammar_tests.py index c2c3d8d..1df28f9 100644 --- a/examples/antlr_grammar_tests.py +++ b/examples/antlr_grammar_tests.py @@ -6,7 +6,7 @@ Created on 4 sept. 2010 Submitted by Luca DallOlio, September, 2010 ''' import unittest -import antlr_grammar +from . import antlr_grammar class Test(unittest.TestCase): @@ -84,4 +84,4 @@ fragment DIGIT : '0'..'9' ;""" if __name__ == "__main__": #import sys;sys.argv = ['', 'Test.testOptionsSpec'] - unittest.main()
\ No newline at end of file + unittest.main() diff --git a/examples/test_bibparse.py b/examples/test_bibparse.py index 7440a66..78f5bb7 100644 --- a/examples/test_bibparse.py +++ b/examples/test_bibparse.py @@ -3,8 +3,8 @@ from os.path import join as pjoin, dirname
from pyparsing import ParseException
-from btpyparse import Macro
-import btpyparse as bp
+from .btpyparse import Macro
+from . import btpyparse as bp
from nose.tools import assert_true, assert_false, assert_equal, assert_raises
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} ), ] |