diff options
author | Cole Robinson <crobinso@redhat.com> | 2019-07-17 16:54:59 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2019-07-17 16:54:59 -0400 |
commit | 2897951ce19ff501b493e35f448f1621b8b1be20 (patch) | |
tree | 1ac1aed41f85f51a98863b9e25c1657e7f410411 /tests | |
parent | ef46af706a49c6b6e68986324228e1e2ad46caf9 (diff) | |
download | virt-manager-2897951ce19ff501b493e35f448f1621b8b1be20.tar.gz |
tests: Drop os.system calls
Use python native code instead. This seems to avoid an occasional
crash or abort of some sort with latest libosinfo
Diffstat (limited to 'tests')
-rw-r--r-- | tests/clitest.py | 4 | ||||
-rw-r--r-- | tests/clonetest.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/clitest.py b/tests/clitest.py index 40041184..ddc84c8e 100644 --- a/tests/clitest.py +++ b/tests/clitest.py @@ -1420,8 +1420,8 @@ def cleanup(): Cleanup temporary files used for testing """ for i in clean_files: - os.system("chmod 777 %s > /dev/null 2>&1" % i) - os.system("rm -rf %s > /dev/null 2>&1" % i) + if os.path.exists(i): + os.unlink(i) class CLITests(unittest.TestCase): diff --git a/tests/clonetest.py b/tests/clonetest.py index ee0c72d7..d9d6f288 100644 --- a/tests/clonetest.py +++ b/tests/clonetest.py @@ -35,7 +35,7 @@ class TestClone(unittest.TestCase): def setUp(self): for f in local_files: - os.system("touch %s" % f) + open(f, "w").write("") def tearDown(self): for f in local_files: |