From 80fdc0bf867cbfbbe4f1ce99e6e01ca4c5b26e3c Mon Sep 17 00:00:00 2001 From: Spencer Low Date: Mon, 14 Sep 2015 18:50:13 -0700 Subject: [PATCH] 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 --- adb/test_device.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adb/test_device.py b/adb/test_device.py index fedd2d755..0cfc41fb6 100644 --- a/adb/test_device.py +++ b/adb/test_device.py @@ -470,7 +470,8 @@ class FileOperationsTest(DeviceTest): 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."""