diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-06-22 11:04:06 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-06-22 21:17:36 +0900 |
commit | fbe1352e0fc9e8eae2e3dcbf9a99747f74e2d705 (patch) | |
tree | 5c045a64702149c96215ea99795a62c7aada1e0f /tests | |
parent | 4a59dbf1e124b3154c65000768d10a69516f08f1 (diff) | |
download | buildstream-fbe1352e0fc9e8eae2e3dcbf9a99747f74e2d705.tar.gz |
test/sources/ostree.py: Fix ResourceWarning when calling subprocess
This switches the code from using subprocess.Popen() manually to using
subprocess.call(), which achieves the same thing and also handles
resource cleanup for us. I also removed an unused variable.
Fixes warnings like these that the test suite was producing:
tests/sources/ostree.py::test_ostree_shell_exe
/home/shared/src/buildstream/tests/sources/ostree.py:79: ResourceWarning: unclosed file <_io.BufferedReader name=13>
ret = run_ostree_bash_script()
Diffstat (limited to 'tests')
-rw-r--r-- | tests/sources/ostree.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/sources/ostree.py b/tests/sources/ostree.py index f9763e868..1a270a0bb 100644 --- a/tests/sources/ostree.py +++ b/tests/sources/ostree.py @@ -34,14 +34,9 @@ class OSTreeSetup(Setup): def run_ostree_bash_script(): # Run the generate-ostree.sh script - - process = subprocess.Popen( + return subprocess.call( ['%s/generate-ostree.sh' % (DATA_DIR,)], stderr=subprocess.PIPE) - process.wait() - BASH_DONE = True - - return process.returncode def run_ostree_cli(repo, cmd): |