Convert some try/finally to addCleanup
This commit is contained in:
@@ -331,11 +331,7 @@ class EmailOptInListTest(ModuleStoreTestCase):
|
||||
# Create a temporary directory for the output
|
||||
# Delete it when we're finished
|
||||
temp_dir_path = tempfile.mkdtemp()
|
||||
|
||||
def _cleanup(): # pylint: disable=missing-docstring
|
||||
shutil.rmtree(temp_dir_path)
|
||||
|
||||
self.addCleanup(_cleanup)
|
||||
self.addCleanup(shutil.rmtree, temp_dir_path)
|
||||
|
||||
# Sanitize the arguments
|
||||
if other_names is None:
|
||||
|
||||
Reference in New Issue
Block a user