1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed isolation of test_check_errors_catches_all_exceptions.

This commit is contained in:
Mariusz Felisiak 2021-01-18 12:50:51 +01:00
parent bef6f75842
commit e8b4f23115

View File

@ -98,8 +98,11 @@ class TestIterModulesAndFiles(SimpleTestCase):
filename = self.temporary_file('test_exception.py')
filename.write_text('raise Exception')
with extend_sys_path(str(filename.parent)):
with self.assertRaises(Exception):
autoreload.check_errors(import_module)('test_exception')
try:
with self.assertRaises(Exception):
autoreload.check_errors(import_module)('test_exception')
finally:
autoreload._exception = None
self.assertFileFound(filename)
def test_zip_reload(self):