From 2ef8bb1c87905a5ce0c685d99a00a6741350f1fe Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 19 Mar 2017 16:48:24 -0700 Subject: py2/3 fix rb/wb also replace convoluted test logic with correct test methods to check for file exist/not exist --- test/TEX/PDFTEXFLAGS.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/TEX/PDFTEXFLAGS.py b/test/TEX/PDFTEXFLAGS.py index 06dc780..97b352e 100644 --- a/test/TEX/PDFTEXFLAGS.py +++ b/test/TEX/PDFTEXFLAGS.py @@ -43,8 +43,8 @@ opt_string = '' for opt, arg in cmd_opts: opt_string = opt_string + ' ' + opt base_name = os.path.splitext(args[0])[0] -infile = open(args[0], 'rb') -out_file = open(base_name+'.pdf', 'wb') +infile = open(args[0], 'r') +out_file = open(base_name+'.pdf', 'w') out_file.write(opt_string + "\n") for l in infile.readlines(): if l[0] != '\\': @@ -96,15 +96,15 @@ This is the %s TeX file. test.run(arguments = 'foo.pdf', stderr = None) - test.fail_test(os.path.exists(test.workpath('wrapper.out'))) + test.must_not_exist(test.workpath('wrapper.out')) - test.fail_test(not os.path.exists(test.workpath('foo.pdf'))) + test.must_exist(test.workpath('foo.pdf')) test.run(arguments = 'bar.pdf', stderr = None) - test.fail_test(not os.path.exists(test.workpath('wrapper.out'))) + test.must_exist(test.workpath('wrapper.out')) - test.fail_test(not os.path.exists(test.workpath('bar.pdf'))) + test.must_exist(test.workpath('bar.pdf')) test.pass_test() -- cgit v0.12