Changes between Version 2 and Version 5 of Ticket #32611


Ignore:
Timestamp:
Apr 7, 2021, 12:02:01 AM (4 years ago)
Author:
Chris Jerdonek
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32611

    • Property Type UncategorizedCleanup/optimization
    • Property Has patch set
    • Property Summary runtest.py's bisect_tests() and paired_tests() don't seem to need settings setup and teardownruntests.py's bisect_tests() and paired_tests() don't always need to do setup and teardown
  • Ticket #32611 – Description

    v2 v5  
    1 Currently, `runtest.py`'s [https://github.com/django/django/blob/main/tests/runtests.py#L346 bisect_tests()] and [https://github.com/django/django/blob/main/tests/runtests.py#L397 paired_tests()] both call `runtest.py`'s `setup()` and `teardown()`. However, it doesn't seem like they need to (in full).
     1Currently, `runtests.py`'s [https://github.com/django/django/blob/main/tests/runtests.py#L346 bisect_tests()] and [https://github.com/django/django/blob/main/tests/runtests.py#L397 paired_tests()] both call `runtests.py`'s `setup()` and `teardown()`. However, it doesn't seem like they need to (in full).
    22
    33The `setup()` function's primary purpose is to temporarily set `settings` for the purposes of the test run, but `bisect_tests()` and `paired_tests()` both run tests in a subprocess, so settings modification doesn't seem like it should be necessary. The only things the call to `setup()` seem to be needed for in these two cases is to (1) do some initial logging of the test run, and (2) do some work to compute `test_labels` in the case that `test_labels` aren't provided. So those pieces could be factored out.
Back to Top