Change how patches are imported/applied, and patch during test runs.

Review Request #11993 — Created Jan. 24, 2022 and submitted — Latest diff uploaded

Information

Django Evolution
release-2.x

Reviewers

Django Evolution applies patches when starting up, but we weren't doing
this correctly during test runs. This was mostly an issue when testing
under Python 3.10, which has the collections changes that break older
versions of Django.

The test runner now applies patches. However, this unveiled a new
problem: Some patches need to apply before others can be imported,
especially since they import the database layers of Django.

Now, the module managing patch application lazily imports when applying,
rather than importing on module load. This avoids the import issue, and
eases maintenance going forward.

All unit tests pass for all currently supported combinations of Python
and Django.

Commits

Files