#37080: Django's own tests should always treat both Django deprecation warnings 
as
errors
-------------------------------------+-------------------------------------
     Reporter:  Mike Edmunds         |                     Type:
                                     |  Cleanup/optimization
       Status:  new                  |                Component:  Testing
                                     |  framework
      Version:  dev                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Django's runtests.py treats RemovedAfterNextVersionWarning (currently
 equivalent to RemovedInDjango70Warning) as an error, in all releases. And
 in x.0 and x.2 releases, it also treats RemovedInNextVersionWarning as an
 error.

 However, in x.1 releases RemovedInNextVersionWarning is ''not'' handled as
 an error (because there is no RemovedInDjango62Warning, or any x.2
 equivalent).

 This doesn't matter for most Django tests, which use the concrete
 RemovedInDjango70Warning, RemovedInDjango71Warning, etc. But it
 complicates testing Django's own deprecation utilities and assertion
 helpers, and it [https://code.djangoproject.com/ticket/37072#comment:8
 makes discussions of them complicated].

 Suggestion: change runtests.py to use the ''generic'' warnings and treat
 them ''both'' as errors—always, without the need to advance them each
 release:

 {{{#!python
 # Before:
 warnings.simplefilter("error", RemovedInDjango70Warning)

 # After
 warnings.simplefilter("error", RemovedInNextVersionWarning)
 warnings.simplefilter("error", RemovedAfterNextVersionWarning)
 }}}


 (I think this becomes moot if/when we switch to calendar cycle releases.)
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37080>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019de4af250b-1e8708f7-cc3d-4bfa-8a7c-71f25c21c67b-000000%40eu-central-1.amazonses.com.

Reply via email to