1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed a couple unclosed file warnings in tests

This commit is contained in:
Tim Graham
2013-09-03 13:37:27 -04:00
parent 3db66b1d65
commit cb98ffe8f4
2 changed files with 6 additions and 4 deletions

View File

@@ -783,10 +783,11 @@ class TestAppStaticStorage(TestCase):
os.mkdir(self.search_path)
module_path = os.path.join(self.search_path, 'foo_module')
os.mkdir(module_path)
open(os.path.join(module_path, '__init__.py'), 'w')
self.init_file = open(os.path.join(module_path, '__init__.py'), 'w')
sys.path.append(os.path.abspath(self.search_path))
def tearDown(self):
self.init_file.close()
sys.path.remove(os.path.abspath(self.search_path))
shutil.rmtree(self.search_path)