diff options
author | Sascha Silbe <sascha-pgp@silbe.org> | 2012-04-22 14:45:37 (GMT) |
---|---|---|
committer | Sascha Silbe <sascha-pgp@silbe.org> | 2012-04-22 14:45:37 (GMT) |
commit | 91adf602db6d500194cb61cd416d4f4c788adcb5 (patch) | |
tree | 0018111a06baf64f72007f0d6072f80b676d430d | |
parent | 41cb2e6c208201b3257bbe762d93c3804171ee67 (diff) |
tests: properly clean up non-directories in ~/.gdatastore
shutil.rmtree() fails when trying to delete non-directories, so we need to
delete them explicitly using os.remove().
-rwxr-xr-x | tests/runalltests.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/runalltests.py b/tests/runalltests.py index 6b6b25f..424f510 100755 --- a/tests/runalltests.py +++ b/tests/runalltests.py @@ -218,7 +218,11 @@ class TestSuiteWrapper(unittest.TestCase): if name == 'logs': continue - shutil.rmtree(os.path.join(data_store_dir, name)) + path = os.path.join(data_store_dir, name) + if os.path.isdir(path): + shutil.rmtree(path) + else: + os.unlink(path) class TimedTestResult(unittest._TextTestResult): |