diff options
author | Mats Wichmann <mats@linux.com> | 2019-03-31 13:01:00 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-04-25 15:37:04 (GMT) |
commit | f61d3bcd112285644c1a6ce253b267ef690a7e06 (patch) | |
tree | 2e489e238c11697f602cb9a7cbeb43afed088734 /test/packaging/rpm | |
parent | b0c3385604ebc1d7d552472f1cc6d0910aafa32a (diff) | |
download | SCons-f61d3bcd112285644c1a6ce253b267ef690a7e06.zip SCons-f61d3bcd112285644c1a6ce253b267ef690a7e06.tar.gz SCons-f61d3bcd112285644c1a6ce253b267ef690a7e06.tar.bz2 |
[PY 3.8] test fixes for file closings, rawstrings
On a linux host (missing some things that may be on the Travis CI
setup), Py3.8a3 now shows 19 fails, 1048 pass, with 84 Warning: messages.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/packaging/rpm')
-rw-r--r-- | test/packaging/rpm/internationalization.py | 22 | ||||
-rw-r--r-- | test/packaging/rpm/multipackage.py | 6 | ||||
-rw-r--r-- | test/packaging/rpm/package.py | 8 | ||||
-rw-r--r-- | test/packaging/rpm/tagging.py | 6 |
4 files changed, 26 insertions, 16 deletions
diff --git a/test/packaging/rpm/internationalization.py b/test/packaging/rpm/internationalization.py index ad77f40..eea30ca 100644 --- a/test/packaging/rpm/internationalization.py +++ b/test/packaging/rpm/internationalization.py @@ -94,25 +94,29 @@ machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine() test.must_exist( src_rpm ) test.must_exist( machine_rpm ) -test.must_not_exist( 'bin/main' ) +test.must_not_exist('bin/main') cmd = 'rpm -qp --queryformat \'%%{GROUP}-%%{SUMMARY}-%%{DESCRIPTION}\' %s' os.environ['LANGUAGE'] = 'de' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Applikation/büro-hallo-das sollte wirklich lang sein' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Applikation/büro-hallo-das sollte wirklich lang sein') os.environ['LANGUAGE'] = 'fr' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Application/bureau-bonjour-ceci devrait être vraiment long' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Application/bureau-bonjour-ceci devrait être vraiment long') os.environ['LANGUAGE'] = 'en' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Application/office-hello-this should be really long' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Application/office-hello-this should be really long') os.environ['LC_ALL'] = 'ae' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Application/office-hello-this should be really long' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Application/office-hello-this should be really long') # # test INTERNATIONAL PACKAGE TAGS diff --git a/test/packaging/rpm/multipackage.py b/test/packaging/rpm/multipackage.py index fd67a09..2f106f4 100644 --- a/test/packaging/rpm/multipackage.py +++ b/test/packaging/rpm/multipackage.py @@ -104,9 +104,11 @@ test.must_exist( machine_rpm2 ) test.must_exist( src_rpm2 ) test.must_not_exist( 'bin/main' ) -out = os.popen( 'rpm -qpl %s' % machine_rpm).read() +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() test.must_contain_all_lines( out, '/bin/main') -out = os.popen( 'rpm -qpl %s' % src_rpm).read() +with os.popen('rpm -qpl %s' % src_rpm) as p: + out = p.read() test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n') test.pass_test() diff --git a/test/packaging/rpm/package.py b/test/packaging/rpm/package.py index 2ba66b9..ddd3c89 100644 --- a/test/packaging/rpm/package.py +++ b/test/packaging/rpm/package.py @@ -83,9 +83,11 @@ machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine() test.must_exist( machine_rpm ) test.must_exist( src_rpm ) test.must_not_exist( 'bin/main' ) -out = os.popen( 'rpm -qpl %s' % machine_rpm).read() -test.must_contain_all_lines( out, '/bin/main') -out = os.popen( 'rpm -qpl %s' % src_rpm).read() +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() +test.must_contain_all_lines(out, '/bin/main') +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n') test.pass_test() diff --git a/test/packaging/rpm/tagging.py b/test/packaging/rpm/tagging.py index b685c91..c730e14 100644 --- a/test/packaging/rpm/tagging.py +++ b/test/packaging/rpm/tagging.py @@ -85,11 +85,13 @@ src_rpm = 'foo-1.2.3-0.src.rpm' machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine() test.must_exist( machine_rpm ) -out = os.popen('rpm -qpl %s' % machine_rpm).read() +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() test.must_contain_all_lines( out, '/bin/main') test.must_exist( src_rpm ) -out = os.popen('rpm -qpl %s' % src_rpm).read() +with os.popen('rpm -qpl %s' % src_rpm) as p: + out = p.read() test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n') expect = '(0755, root, users) /bin/main' |