summaryrefslogtreecommitdiffstats
path: root/test/SWIG
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2017-03-19 20:04:32 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2017-03-19 20:04:32 (GMT)
commit46fd61694e79ec07c9317f62914bd90dbc7fe5c6 (patch)
tree50414ca393c13e374411f0c303c28416fd0f1e2f /test/SWIG
parent3a9b41372bb91a7ba7bcf6f80ee11df440202909 (diff)
downloadSCons-46fd61694e79ec07c9317f62914bd90dbc7fe5c6.zip
SCons-46fd61694e79ec07c9317f62914bd90dbc7fe5c6.tar.gz
SCons-46fd61694e79ec07c9317f62914bd90dbc7fe5c6.tar.bz2
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 38bdc97..31bc7d7 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))