Convert some try/finally to addCleanup
This commit is contained in:
@@ -175,14 +175,12 @@ class CommandsTestBase(ModuleStoreTestCase):
|
||||
|
||||
def test_export_course(self):
|
||||
tmp_dir = path(mkdtemp())
|
||||
self.addCleanup(shutil.rmtree, tmp_dir)
|
||||
filename = tmp_dir / 'test.tar.gz'
|
||||
try:
|
||||
self.run_export_course(filename)
|
||||
with tarfile.open(filename) as tar_file:
|
||||
self.check_export_file(tar_file)
|
||||
|
||||
finally:
|
||||
shutil.rmtree(tmp_dir)
|
||||
self.run_export_course(filename)
|
||||
with tarfile.open(filename) as tar_file:
|
||||
self.check_export_file(tar_file)
|
||||
|
||||
def test_export_course_stdout(self):
|
||||
output = self.run_export_course('-')
|
||||
|
||||
Reference in New Issue
Block a user