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)
| 8 | @requireCapability(dialect=NotEQ("mssql")) |
| 9 | @pytest.mark.asyncio |
| 10 | async 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 |