From 82c6ab50d4c996d9062d2ea08e82fa265926930d Mon Sep 17 00:00:00 2001 From: Justin Abrahms Date: Thu, 15 Oct 2015 09:47:41 -0700 Subject: [PATCH] Don't double-create temp directories. --- .../import_export/courses/tests/test_course_import_export.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openedx/core/djangoapps/import_export/courses/tests/test_course_import_export.py b/openedx/core/djangoapps/import_export/courses/tests/test_course_import_export.py index 039321ae1f..705dc74486 100644 --- a/openedx/core/djangoapps/import_export/courses/tests/test_course_import_export.py +++ b/openedx/core/djangoapps/import_export/courses/tests/test_course_import_export.py @@ -341,12 +341,11 @@ class ImportTestCase(CourseTestCase): self.assertIn(test_block3.url_name, children) self.assertIn(test_block4.url_name, children) - extract_dir = path(tempfile.mkdtemp(dir=settings.DATA_DIR)) + extract_dir = path(mkdtemp_clean(dir=settings.DATA_DIR)) # the extract_dir needs to be passed as a relative dir to # import_library_from_xml extract_dir_relative = path.relpath(extract_dir, settings.DATA_DIR) - extract_dir = path(mkdtemp_clean()) with tarfile.open(path(TEST_DATA_DIR) / 'imports' / 'library.HhJfPD.tar.gz') as tar: safetar_extractall(tar, extract_dir) library_items = import_library_from_xml(