flake8
-
djblets/testing/testcases.py (Diff revision 1)
Review Request #13372 — Created Oct. 23, 2023 and submitted
This updates
assertQueries()
to check for and compare subquery
information. This takes in aninner_query
attribute that matches the
query comparison dictionary and checks against it.This wasn't supported before, and because of that, this support must be
optional or we'll break existing tests. Currently, consumers can pass in
check_subqueries=True
to enable this. That will be the default in
Djblets 5. For now, if a subquery is found and no explicit
check_subqueries
value is provided, a deprecation warning will be
emitted.Formatting has also improved, in part to help output subquery comparison
details. All values are now passed throughpprint.pformat()
, and if
the results span multiple lines, it will be formatted with proper
indentation and alignment to help with reading the output.
All Djblets and Review Board unit tests pass.
Summary | ID |
---|---|
f422f1f0521da2cf74d835120cbf9642b18662d1 |
Description | From | Last Updated |
---|---|---|
'djblets.db.query_catcher.ExecutedQueryInfo' imported but unused Column: 1 Error code: F401 |
reviewbot | |
Should list check_subqueries here. |
david | |
Instead of "update your query expectations to begin migrating to these new checks", how about "update your query expectations to … |
david | |
Wording is off here. |
maubin |
Removed an unused import.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+294 -64) |
Description: |
|
---|
Fixed a bug causing inner query matching to factor in outer query expectations.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+326 -86) |
djblets/testing/testcases.py (Diff revision 3) |
---|
Instead of "update your query expectations to begin migrating to these new checks", how about "update your query expectations to include the subquery"?
check_subqueries
to the list of changes for assertQueries()
.check_subqueries
isn't on.Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 4 (+326 -86) |