adb unittest: make test_sync properly cleanup after itself
It wasn't deleting the tempfile.mkdtemp() dir that it made.
Change-Id: I59c5f98aa8297c7b28d38799dd21ffe9566f2145
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
diff --git a/adb/test_device.py b/adb/test_device.py
index fedd2d7..0cfc41f 100644
--- a/adb/test_device.py
+++ b/adb/test_device.py
@@ -470,7 +470,8 @@
self.assertEqual(temp_file.checksum, dev_md5)
self.device.shell(['rm', '-rf', self.DEVICE_TEMP_DIR])
- shutil.rmtree(base_dir + self.DEVICE_TEMP_DIR)
+ if base_dir is not None:
+ shutil.rmtree(base_dir)
def test_unicode_paths(self):
"""Ensure that we can support non-ASCII paths, even on Windows."""