[Django] #28224: Test suite exception catching is not always specific

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #28224: Test suite exception catching is not always specific

Django
#28224: Test suite exception catching is not always specific
-------------------------------------+-------------------------------------
               Reporter:  Mads       |          Owner:  nobody
  Jensen                             |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Core       |        Version:  master
  (Other)                            |
               Severity:  Normal     |       Keywords:  exception classes
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 `tests/requests/tests.py` contains some less specific tests. Actually,
 it's `DisallowedHost` that's being raised instead for all of these cases.
 Isn't it better in general to test for the actual exception class?
 Probably there are other cases of tests like this that could be made more
 specific.

 {{{
 with self.assertRaises(SuspiciousOperation):
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28224>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/053.c9f5e998018e1e99cf26e29a00f9d202%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28224: Use more specific exception testing in Django's tests (was: Test suite exception catching is not always specific)

Django
#28224: Use more specific exception testing in Django's tests
--------------------------------------+------------------------------------
     Reporter:  Mads Jensen           |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Core (Other)          |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:  exception classes     |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28224#comment:1>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.985a9c7e8ae9bc8802dff71d581e0ac6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28224: Use more specific exception testing in Django's tests

Django
In reply to this post by Django
#28224: Use more specific exception testing in Django's tests
-------------------------------------+-------------------------------------
     Reporter:  Mads Jensen          |                    Owner:  Rajesh
         Type:                       |  Veeranki
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Other)         |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  exception classes    |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Rajesh Veeranki):

 * owner:  nobody => Rajesh Veeranki
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28224#comment:2>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.dced0391992e23f5286288a3fbe30b38%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28224: Use more specific exception testing in Django's tests

Django
In reply to this post by Django
#28224: Use more specific exception testing in Django's tests
-------------------------------------+-------------------------------------
     Reporter:  Mads Jensen          |                    Owner:  Rajesh
         Type:                       |  Veeranki
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Other)         |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  exception classes    |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Rajesh Veeranki):

 * has_patch:  0 => 1


Comment:

 Please review the PR here: https://github.com/django/django/pull/8545
 I have searched the tests for any instances of `SuspiciousOperation` and
 replaced with appropriate derived exception

--
Ticket URL: <https://code.djangoproject.com/ticket/28224#comment:3>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.dd7c036db3266f2199d9e9a7d597c413%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28224: Test for SuspiciousOperation subclasses rather than SuspiciousOperation in Django's tests (was: Use more specific exception testing in Django's tests)

Django
In reply to this post by Django
#28224: Test for SuspiciousOperation subclasses rather than SuspiciousOperation in
Django's tests
-------------------------------------+-------------------------------------
     Reporter:  Mads Jensen          |                    Owner:  Rajesh
         Type:                       |  Veeranki
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Other)         |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  exception classes    |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * stage:  Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28224#comment:4>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.3f74f7733fac96d3eb6510c3a7fede16%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #28224: Test for SuspiciousOperation subclasses rather than SuspiciousOperation in Django's tests

Django
In reply to this post by Django
#28224: Test for SuspiciousOperation subclasses rather than SuspiciousOperation in
Django's tests
-------------------------------------+-------------------------------------
     Reporter:  Mads Jensen          |                    Owner:  Rajesh
         Type:                       |  Veeranki
  Cleanup/optimization               |                   Status:  closed
    Component:  Core (Other)         |                  Version:  master
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  exception classes    |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"67e1afb4a8478af6725e45a9fdcd2a511b2eb005" 67e1afb4]:
 {{{
 #!CommitTicketReference repository=""
 revision="67e1afb4a8478af6725e45a9fdcd2a511b2eb005"
 Fixed #28224 -- Tested for SuspiciousOperation subclasses in Django's
 tests.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28224#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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.b7beac1791215d622bcada7e2d1ff421%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.