#32609: runtests.py setup should use DiscoverRunner's test label logic
-------------------------------------+-------------------------------------
               Reporter:  Chris      |          Owner:  nobody
  Jerdonek                           |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Testing    |        Version:  dev
  framework                          |       Keywords:
               Severity:  Normal     |  DiscoverRunner,runtests
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I noticed that `runtests.py` does its own rudimentary "parsing" of the
 provided test labels here:
 
https://github.com/django/django/blob/548dce50cf548e777a0c34b5485a146a0606ae73/tests/runtests.py#L128-L132

 However, it would be better if it used the same logic as
 `DiscoverRunner.build_suite()`:
 
https://github.com/django/django/blob/548dce50cf548e777a0c34b5485a146a0606ae73/django/test/runner.py#L612

 There are a few reasons for this. First, it would let `runtests` take into
 account the test tags when determining which app modules apply. Second, it
 would centralize the test label logic, which should simplify maintenance.
 (For example, I was previously unaware of this code path, which explains
 why some things mysteriously weren't working before.) Third, it might even
 permit test labels to be directory paths when used with `runtests.py`, as
 a free side effect. (Currently, directory paths don't seem to work with
 `runtests.py`, I believe for this reason.)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32609>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.a67a7090b012d8d9fdf50d9f97985e85%40djangoproject.com.

Reply via email to