diff --git a/tests/test_import.py b/tests/test_import.py index 7a63921..7276f95 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -90,7 +90,9 @@ class TestImport(unittest.TestCase): dotfile2, content2 = create_random_file(os.path.expanduser('~')) self.addCleanup(clean, dotfile2) homeconf = os.path.join(os.path.expanduser('~'), '.config') - os.mkdir(homeconf) + if not os.path.exists(homeconf): + os.mkdir(homeconf) + self.addCleanup(clean, homeconf) dotconfig = os.path.join(homeconf, get_string(5)) create_dir(dotconfig) self.addCleanup(clean, dotconfig)