[Django] #29127: manage.py executting tagged tests with syntax error does not show them

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

[Django] #29127: manage.py executting tagged tests with syntax error does not show them

Django
#29127: manage.py executting tagged tests with syntax error does not show them
-------------------------------------+-------------------------------------
               Reporter:  Kryštof    |          Owner:  nobody
  Řeháček                            |
                   Type:  Bug        |         Status:  new
              Component:  Testing    |        Version:  2.0
  framework                          |       Keywords:  tests, tagged-
               Severity:  Normal     |  tests, SyntaxError
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 When I execute tests with syntax error without any argument then it shows
 `SyntaxError: invalid syntax` as expected but when I execute tagged tests,
 then it shows that it ran 0 tests and it is OK and even error. So when
 tests with syntax executed with the --tag="some_tag" argument and they
 have syntax error then they complete with OK status.

--
Ticket URL: <https://code.djangoproject.com/ticket/29127>
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/052.c0008f4bd6a88dd75a84429fab084955%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29127: manage.py executing tagged tests with syntax error does not show them (was: manage.py executting tagged tests with syntax error does not show them)

Django
#29127: manage.py executing tagged tests with syntax error does not show them
-------------------------------------+-------------------------------------
     Reporter:  Kryštof Řeháček      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Testing framework    |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  tests, tagged-       |             Triage Stage:
  tests, SyntaxError                 |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/29127#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/067.b11d039d7338eb219ad92c988d2cfdcb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29127: Running tagged tests hides any with syntax errors (was: manage.py executing tagged tests with syntax error does not show them)

Django
In reply to this post by Django
#29127: Running tagged tests hides any with syntax errors
-------------------------------------+-------------------------------------
     Reporter:  Kryštof Řeháček      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Testing framework    |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  tests, tagged-       |             Triage Stage:  Accepted
  tests, SyntaxError                 |
    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


Comment:

 The problem may be in `django.test.runner.filter_tests_by_tags()`.

--
Ticket URL: <https://code.djangoproject.com/ticket/29127#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/067.76d7d41508989dde8ec5499c7dd060e5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29127: Running tagged tests hides any with syntax errors

Django
In reply to this post by Django
#29127: Running tagged tests hides any with syntax errors
-------------------------------------+-------------------------------------
     Reporter:  Kryštof Řeháček      |                    Owner:  Daniel
                                     |  Hones
         Type:  Bug                  |                   Status:  assigned
    Component:  Testing framework    |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  tests, tagged-       |             Triage Stage:  Accepted
  tests, SyntaxError                 |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Daniel Hones):

 * owner:  nobody => Daniel Hones
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29127#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/067.dcb7c8ecbf827142ec1a2a915104acf3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29127: Running tagged tests hides any with syntax errors

Django
In reply to this post by Django
#29127: Running tagged tests hides any with syntax errors
-------------------------------------+-------------------------------------
     Reporter:  Kryštof Řeháček      |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Testing framework    |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  tests, tagged-       |             Triage Stage:  Accepted
  tests, SyntaxError                 |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Daniel Hones):

 * status:  assigned => new
 * owner:  Daniel Hones => (none)


Comment:

 It looks like this behavior is ultimately due to Python's unittest
 TestLoader and not Django's test framework.  In case of a SyntaxError when
 loading a test suite, it hits
 [https://github.com/python/cpython/blob/master/Lib/unittest/loader.py#L439
 this line], which creates a _FailedTest object from it without raising an
 error.  Then the {{{django.test.runner.filter_tests_by_tags()}}} sees a
 _FailedTest object which won't have any tags and so it won't be run at
 all.  Since tests are tagged using a decorator, tests in a file with a
 syntax error won't have any tags recognized for them anyway because the
 file cannot be evaluated.  I don't think there's a reasonable fix for this
 and I'm not sure it should even be considered a bug, although the behavior
 is a bit misleading.

--
Ticket URL: <https://code.djangoproject.com/ticket/29127#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/067.6b7721353116d5fc5d5e87bf4be15d35%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.