]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add delete returning test property
authorDaniel Black <daniel@mariadb.org>
Mon, 13 Sep 2021 14:26:56 +0000 (00:26 +1000)
committerDaniel Black <daniel@mariadb.org>
Sat, 25 Sep 2021 06:23:19 +0000 (16:23 +1000)
lib/sqlalchemy/testing/requirements.py
test/sql/test_returning.py

index ad866c851a4c79fb64726c40e3569f7250d495a4..2afdb9677e40826ed9e9786f99bdbc4f662fa18b 100644 (file)
@@ -359,6 +359,15 @@ class SuiteRequirements(Requirements):
 
         return exclusions.open()
 
+    @property
+    def delete_returning(self):
+        """target platform supports DELETE ... RETURNING."""
+
+        return exclusions.only_if(
+            lambda config: config.db.dialect.delete_returning,
+            "%(database)s %(does_support)s 'DELETE ... RETURNING'",
+        )
+
     @property
     def insert_returning(self):
         """target platform supports INSERT ... RETURNING."""
index 10bf3beb6fe9b44576c79bd338d09076148529e1..e2612ebed9cead341e7956136d58ddd04b691481 100644 (file)
@@ -299,8 +299,8 @@ class ReturningTest(fixtures.TablesTest, AssertsExecutionResults):
         )
         eq_(result.fetchall(), [(1, True), (2, True)])
 
-    @testing.requires.full_returning
-    def test_delete_full_returning(self, connection):
+    @testing.requires.delete_returning
+    def test_delete_returning(self, connection):
         table = self.tables.tables
         connection.execute(
             table.insert(),