From 70c945d6b31b41b320e57088702077864428fdc0 Mon Sep 17 00:00:00 2001 From: Christophe Baldy Date: Thu, 24 Nov 2022 19:41:08 +0100 Subject: [PATCH] Used DatabaseFeatures.django_test_skips to skip AssertNumQueriesUponConnectionTests tests. --- django/db/backends/sqlite3/features.py | 5 +++++ tests/test_utils/tests.py | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py index ae347c30f5e..66d25bd1452 100644 --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/features.py @@ -109,6 +109,11 @@ class DatabaseFeatures(BaseDatabaseFeatures): "servers.tests.LiveServerTestCloseConnectionTest." "test_closes_connections", }, + "For SQLite in-memory tests, closing the connection destroys" + "the database.": { + "test_utils.tests.AssertNumQueriesUponConnectionTests." + "test_ignores_connection_configuration_queries", + }, } ) else: diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 9304f22a2ea..79757045dd3 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -235,10 +235,6 @@ class AssertNumQueriesTests(TestCase): self.assertNumQueries(2, test_func) -@unittest.skipUnless( - connection.vendor != "sqlite" or not connection.is_in_memory_db(), - "For SQLite in-memory tests, closing the connection destroys the database.", -) class AssertNumQueriesUponConnectionTests(TransactionTestCase): available_apps = []