MCPcopy
hub / github.com/tortoise/tortoise-orm / test_explain

Function test_explain

tests/backends/test_explain.py:10–20  ·  view source on GitHub ↗

Test that explain() returns query plan information. NOTE: we do not provide any guarantee on the format of the value returned by `.explain()`, as it heavily depends on the database. This test merely checks that one is able to run `.explain()` without errors for each backend.

(db)

Source from the content-addressed store, hash-verified

8@requireCapability(dialect=NotEQ("mssql"))
9@pytest.mark.asyncio
10async def test_explain(db):
11 """Test that explain() returns query plan information.
12
13 NOTE: we do not provide any guarantee on the format of the value
14 returned by `.explain()`, as it heavily depends on the database.
15 This test merely checks that one is able to run `.explain()`
16 without errors for each backend.
17 """
18 plan = await Tournament.all().explain()
19 # This should have returned *some* information.
20 assert len(str(plan)) > 20

Callers

nothing calls this directly

Calls 2

explainMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…