summaryrefslogtreecommitdiff
path: root/test/GenerateTests.py
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2016-01-27 10:44:41 +0100
committerJohn Wiegley <johnw@newartisans.com>2019-12-05 15:06:44 +0100
commite1bba5d977a8b9385e9ffdb05861833485003d23 (patch)
tree40876bb3d289ced0fd871e94cc9e79c9e934327b /test/GenerateTests.py
parente264eb618b8eabf9670084f40687af916a63567e (diff)
downloadfork-ledger-e1bba5d977a8b9385e9ffdb05861833485003d23.tar.gz
fork-ledger-e1bba5d977a8b9385e9ffdb05861833485003d23.tar.bz2
fork-ledger-e1bba5d977a8b9385e9ffdb05861833485003d23.zip
Make tests scripts Python 3 compatible
Diffstat (limited to 'test/GenerateTests.py')
-rwxr-xr-xtest/GenerateTests.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/GenerateTests.py b/test/GenerateTests.py
index 1a9045a2..d5851821 100755
--- a/test/GenerateTests.py
+++ b/test/GenerateTests.py
@@ -3,6 +3,8 @@
# This script confirms both that the register report "adds up", and that its
# final balance is the same as what the balance report shows.
+from __future__ import print_function
+
import sys
import re
@@ -68,8 +70,8 @@ def generation_test(seed):
#cerr_lines = [normalize(line) for line in p_cerr_bal.stdout.readlines()]
#
#if p_cerr_bal.wait() != 0:
- # print "Stderr balance for seed %d failed due to error:" % seed
- # print p_cerr_bal.stderr.read()
+ # print("Stderr balance for seed %d failed due to error:" % seed)
+ # print(p_cerr_bal.stderr.read())
# del p_cerr_bal
# return False
#del p_cerr_bal
@@ -103,23 +105,23 @@ def generation_test(seed):
# if line[:2] == " ":
# continue
# if not printed:
- # if success: print
- # print "Generation failure in output from seed %d (cerr vs. cout):" % seed
+ # if success: print()
+ # print("Generation failure in output from seed %d (cerr vs. cout):" % seed)
# if success: failed += 1
# success = False
# printed = True
- # print " ", line
+ # print(" ", line)
printed = False
for line in ndiff(cout_lines, print_lines, charjunk=None):
if line[:2] == " ":
continue
if not printed:
- if success: print
- print "Generation failure in output from seed %d (cout vs. print):" % seed
+ if success: print()
+ print("Generation failure in output from seed %d (cout vs. print):" % seed)
success = False
printed = True
- print " ", line
+ print(" ", line)
return success