Django 3.2 Update for “Speed Up Your Django Tests” Released2021-07-08
I released my book “Speed Up Your Django Tests” over a year ago, in May 2020. Since then, we’ve seen two major Django releases, including a whole bunch of test-related changes, some of which I worked on as part of the book.
Today I’m releasing the first update for SUYDT. The update brings the existing content up to date with Python 3.9, Django 3.2, and some future changes for Django 4.0. It also includes some new sections on mocking time and parallelizing tests. And for those who with e-readers, it now comes as an ePub file, alongside the original flavour PDF (one purchase gives you both formats!).
This update is free for existing readers, and does not increase the price. You can buy it now on Gumroad. For those outside of the richest top 50 countries by GDP, there’s a 50% discount.
The book has a changelog at the end of the “Introduction” chapter. Here’s the entry for this update:
- Added ePub file to the release. Thanks to Mike Lissner and Paolo Melchiorre for requesting and testing it.
- Upgraded to Python 3.9 and Django 3.2 and updated content to reflect changes.
- Added Mock Time section to the “Targeted Mocking” chapter, describing my library time-machine.
- Added a section to “Parallelize” on implementing shared resource locking with a pytest fixture.
- Added note in Chapter 9 about Circle CI test splitting.
- Updated section on_commit() callbacks to cover Django 3.2’s
captureOnCommitCallbacks()method, and its backport in django-capture-on-commit-callbacks.
- Updated section Use setUpTestData to cover Django 3.2’s merging of django-testdata, and link to my “How to convert” post.
- Updated section Prevent Output to cover Django 4.0’s
--buffer --parallelsupport, and fix error reporting in example code.
- Updated section Activate Parallelization to better describe the multiprocessing start methods, and reflect the current status of the spawn method ticket.
- Updated the parallel testing macOS workaround in a safer way, without setting the environment variable globally.
- Moved the Mock Settings section from “Toolbox” to “Targeted Mocking”.
- Renamed chapter 12 to “Targeted Mocking” as “targetted” is a misspelling.
- Fixed some errors reported by Matt Layman, Nat Dunn, and Paolo Melchiorre.
- Fixed links to pytest documentation after it was reorganized.
Thanks to everyone who has already bought SUYDT, and everyone who has helped, directly or indirectly.
🎉 My book Speed Up Your Django Tests is now up to date for Django 3.2. 🎉
Buy now on Gumroad
One summary email a week, no spam, I pinky promise.
Tags: django, python
© 2021 All rights reserved.