#32417: LiveServerTestCase._tearDownClassInternal() has unneeded hasattr check
--------------------------------------+------------------------------------
     Reporter:  Chris Jerdonek        |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Testing framework     |                  Version:  2.2
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

 Replying to [comment:4 Chris Jerdonek]:
 > Are you sure that `super().tearDownClass()` needs to be called in that
 `finally` block? Maybe it only needs to be called in the case that
 `setUpClass()` raises an exception (because otherwise, `tearDownClass()`
 will be called automatically by `unittest`). Maybe that explains why
 something is getting called twice when it shouldn't.

 `StaticLiveServerChecks.tearDownClass()` doesn't call
 `super().tearDownClass()` so `LiveServerTestCase.tearDownClass()` is
 called only once 🤔.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32417#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.7d206b40a6b41cffedec5b826389eca5%40djangoproject.com.

Reply via email to