diff options
author | John Wiegley <johnw@newartisans.com> | 2008-08-05 03:34:25 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-08-05 03:34:25 -0400 |
commit | 806be999ef1f86020b355e4832ea1ac6e5f9adfa (patch) | |
tree | 5982f63d5555c6f6828f09cae12b02f33949c8df /test/regress.py | |
parent | 98c05e8eb2251626fceccfc7565a7a0b06614549 (diff) | |
download | ledger-806be999ef1f86020b355e4832ea1ac6e5f9adfa.tar.gz ledger-806be999ef1f86020b355e4832ea1ac6e5f9adfa.tar.bz2 ledger-806be999ef1f86020b355e4832ea1ac6e5f9adfa.zip |
A few small changes to regress.py to make pylint mostly happy.
Diffstat (limited to 'test/regress.py')
-rwxr-xr-x | test/regress.py | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/test/regress.py b/test/regress.py index e3b1e478..aff17687 100755 --- a/test/regress.py +++ b/test/regress.py @@ -7,7 +7,7 @@ import string import difflib import tempfile -from subprocess import * +from subprocess import Popen, PIPE ledger = sys.argv[1] tests = sys.argv[2] @@ -20,19 +20,19 @@ if not os.path.isdir(tests): succeeded = 0 failed = 0 -def test_regression(file): +def test_regression(test_file): global succeeded, failed - bug = open(file) + bug = open(test_file) command = bug.readline() line = bug.readline() assert "<<<\n" == line line = bug.readline() - input = [] + data = [] while line != ">>>1\n": - input.append(line) + data.append(line) line = bug.readline() line = bug.readline() @@ -44,7 +44,7 @@ def test_regression(file): else: tempdata = tempfile.mkstemp() - os.write(tempdata[0], string.join(input)) + os.write(tempdata[0], string.join(data)) os.close(tempdata[0]) command = ("%s -f \"%s\" " % (ledger, tempdata[1])) + command @@ -70,7 +70,7 @@ def test_regression(file): close_fds=True) if use_stdin: - p.stdin.write(string.join(input)) + p.stdin.write(string.join(data)) p.stdin.close() success = True @@ -83,7 +83,8 @@ def test_regression(file): continue if not printed: if success: print - print "Regression failure in output from %s:" % os.path.basename(file) + print "Regression failure in output from %s:" \ + % os.path.basename(test_file) if success: failed += 1 success = False printed = True @@ -97,7 +98,8 @@ def test_regression(file): continue if not printed: if success: print - print "Regression failure in error output from %s:" % os.path.basename(file) + print "Regression failure in error output from %s:" \ + % os.path.basename(test_file) if success: failed += 1 success = False printed = True @@ -108,7 +110,7 @@ def test_regression(file): if success: failed += 1 success = False print "Regression failure in exitcode from %s: %d (expected) != %d" \ - % (os.path.basename(file), exitcode, p.returncode) + % (os.path.basename(test_file), exitcode, p.returncode) if success: succeeded += 1 |