#22068: Trailing slash after some test suites leads to test failure
-------------------------------------+-------------------------------------
     Reporter:  MattBlack            |                    Owner:
         Type:  Bug                  |  akshay1994.leo
    Component:  Testing framework    |                   Status:  new
     Severity:  Normal               |                  Version:  master
     Keywords:                       |               Resolution:
    Has patch:  1                    |             Triage Stage:  Accepted
  Needs tests:  0                    |      Needs documentation:  0
Easy pickings:  0                    |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by prestontimmons):

 The problem here is that if a trailing slash is supplied, like with
 `./runtests.py test_utils/`, the setup in runtests.py won't recognize the
 path as a module, hence it won't add the module to INSTALLED_APPS. The
 discover runner will still do discovery in the folder, though. This is
 what causes the test failures.

 Tim, your example for `./runtests.py ../django/contrib/admin/` isn't quite
 correct since there aren't any tests in that directory. Try `./runtests.py
 ../django/contrib/sitemaps` and you'll see the problem.

 I think the easiest way to run into this problem is when using tab
 completion. Typing `./runtests.py test_u<tab>` appends the trailing slash,
 which then has to be removed for the tests to run correctly.

 The supplied patch looks like it simply ignores the trailing slash for the
 common case of it being added with tab completion. This could be helpful
 because the test failures don't tell you that the trailing slash caused
 INSTALLED_APPS to be set up incorrectly.

 There would still be failures with a path to the contrib folder, but I
 don't think people run into that very often.

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

Reply via email to