summaryrefslogtreecommitdiff
path: root/test/SWIG
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-19 13:04:32 -0700
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-19 13:04:32 -0700
commitf21aeb83e5cfcec12b0e54a0e6fd5494639bef66 (patch)
tree50414ca393c13e374411f0c303c28416fd0f1e2f /test/SWIG
parent9156f9fb6a585e1f7f0af3d6dc3eb4f0310d375d (diff)
downloadscons-f21aeb83e5cfcec12b0e54a0e6fd5494639bef66.tar.gz
py2/3 fix unnecessary binary reads. pep8 format the file while we're out at
Diffstat (limited to 'test/SWIG')
-rw-r--r--test/SWIG/SWIG.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/SWIG/SWIG.py b/test/SWIG/SWIG.py
index 38bdc970..31bc7d71 100644
--- a/test/SWIG/SWIG.py
+++ b/test/SWIG/SWIG.py
@@ -30,14 +30,14 @@ Verify that the swig tool generates file names that we expect.
import TestSCons
-_exe = TestSCons._exe
-_obj = TestSCons._obj
+_exe = TestSCons._exe
+_obj = TestSCons._obj
test = TestSCons.TestSCons()
python = test.where_is('python')
if not python:
- test,skip_test('Can not find installed "python", skipping test.\n')
+ test.skip_test('Can not find installed "python", skipping test.\n')
test.write('myswig.py', r"""
@@ -57,8 +57,8 @@ for opt, arg in opts:
print("")
print("Please see http://www.swig.org for reporting bugs and further information")
sys.exit(0)
-infile = open(args[0], 'rb')
-outfile = open(out, 'wb')
+infile = open(args[0], 'r')
+outfile = open(out, 'w')
for l in infile.readlines():
if l[:4] != 'swig':
outfile.write(l)
@@ -102,15 +102,16 @@ main(int argc, char *argv[]) {
swig
""")
-test.run(arguments = '.', stderr = None, stdout = r'.*Using SWIG 0.1.2.*', match = TestSCons.match_re_dotall)
+test.run(arguments='.', stderr=None, stdout=r'.*Using SWIG 0.1.2.*',
+ match=TestSCons.match_re_dotall)
-test.run(program = test.workpath('test1' + _exe), stdout = "test1.i\n")
+test.run(program=test.workpath('test1' + _exe), stdout="test1.i\n")
test.must_exist(test.workpath('test1_wrap.c'))
test.must_exist(test.workpath('test1_wrap' + _obj))
-test.must_match('test2_wrap.c', "test2.i\n")
+test.must_match('test2_wrap.c', "test2.i\n", mode='r')
-test.run(program = test.workpath('test3' + _exe), stdout = "test3.i\n")
+test.run(program=test.workpath('test3' + _exe), stdout="test3.i\n")
test.must_exist(test.workpath('test3_wrap.cc'))
test.must_exist(test.workpath('test3_wrap' + _obj))