mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
Fixed #32417 -- Removed unneeded hasattr() check in LiveServerTestCase._tearDownClassInternal().
This commit is contained in:
parent
fc0069bfa5
commit
600ff26a85
@ -1563,18 +1563,14 @@ class LiveServerTestCase(TransactionTestCase):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _tearDownClassInternal(cls):
|
def _tearDownClassInternal(cls):
|
||||||
# There may not be a 'server_thread' attribute if setUpClass() for some
|
# Terminate the live server's thread.
|
||||||
# reasons has raised an exception.
|
cls.server_thread.terminate()
|
||||||
if hasattr(cls, 'server_thread'):
|
# Restore sqlite in-memory database connections' non-shareability.
|
||||||
# Terminate the live server's thread
|
for conn in cls.server_thread.connections_override.values():
|
||||||
cls.server_thread.terminate()
|
conn.dec_thread_sharing()
|
||||||
|
|
||||||
# Restore sqlite in-memory database connections' non-shareability.
|
cls._live_server_modified_settings.disable()
|
||||||
for conn in cls.server_thread.connections_override.values():
|
super().tearDownClass()
|
||||||
conn.dec_thread_sharing()
|
|
||||||
|
|
||||||
cls._live_server_modified_settings.disable()
|
|
||||||
super().tearDownClass()
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user