Split assertQueries's query capturing into a new utility function.
Review Request #13371 — Created Oct. 23, 2023 and submitted
This introduces
djblets.db.query_catcher.catch_queries(), which
contains the query capturing logic fromassertQueries(). Through this,
we now have a formal interface for query capturing that can be
maintained separately fromassertQueries(), 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 checkingdjango.db.connection.queries.
assertQueries()has been updated to use this.
All Djblets and Review Board unit tests pass.
| Summary | ID |
|---|---|
| f35e140963db1730f0dccfd26f8c40fb95873e9e |
| Description | From | Last Updated |
|---|---|---|
|
'traceback' imported but unused Column: 1 Error code: F401 |
|
|
|
'django.contrib.auth.models.Permission' imported but unused Column: 1 Error code: F401 |
|
|
|
'django.contrib.auth.models.User' imported but unused Column: 1 Error code: F401 |
|
|
|
redefinition of unused 'test_with_delete' from line 103 Column: 5 Error code: F811 |
|
- Change Summary:
-
- Removed unused imports.
- Fixed a duplicate test name and re-ran tests.
- Commits:
-
Summary ID 9907ef8a8bf517bd5db9b47d5a5da9766c1c42a8 a39c41f81731f94a64d3360945c6aea3a6b9ff90