This introduces djblets.db.query_catcher.catch_queries()
, which
contains the query capturing logic from assertQueries()
. Through this,
we now have a formal interface for query capturing that can be
maintained separately from assertQueries()
, simplifying that logic
considerably.
With this being a utility function, it's now easier to introspect
queries during development and debug code without having to do the work
from within a unit test. This is very helpful when performance-tuning as
an alternative to checking django.db.connection.queries
.
assertQueries()
has been updated to use this.