#23879: We should use test-skipping, not conditional discovery in runtests.py
------------------------------------------------+------------------------
               Reporter:  carljm                |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Testing framework     |        Version:  1.6
               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                     |
------------------------------------------------+------------------------
 Currently the
 [[https://github.com/django/django/blob/master/tests/runtests.py#L62
 get_test_modules]] function in `runtests.py` has hardcoded skips in place
 for GIS and Postgres-specific tests. We should remove this logic from
 `runtests.py` and instead ensure that the relevant tests use test-skipping
 appropriately. Reasons:

 1. Regardless of the discovery logic in `get_test_modules`, you can always
 run any of these tests explicitly by providing the test label, and if you
 do so with the wrong database, the result should be skipped tests (with a
 reason for the skip which the test runner can output at the appropriate
 verbosity level), not failing tests (which could be quite confusing).

 2. The overall number of tests in Django's test suite (when no test labels
 are provided) should not vary depending on your settings, some tests
 should just be marked as skips. This makes it explicit to someone running
 the tests with a non-Postgres database (for instance) that there are a
 number of Postgres-specific tests which are being skipped for them, rather
 than silently hiding those tests entirely.

--
Ticket URL: <https://code.djangoproject.com/ticket/23879>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.26159da00cfd08b4983f0d04099aae87%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to