]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
refactor: remove unused variable assignments in tests
authorShamil <ashm.tech@proton.me>
Fri, 18 Apr 2025 10:48:02 +0000 (13:48 +0300)
committerShamil <ashm.tech@proton.me>
Fri, 18 Apr 2025 10:48:02 +0000 (13:48 +0300)
Cleaned up unnecessary variable assignments in test cases to reduce clutter and improve readability. No functional changes were made to the test logic.

lib/sqlalchemy/testing/suite/test_dialect.py
lib/sqlalchemy/testing/suite/test_reflection.py
lib/sqlalchemy/testing/suite/test_select.py

index ae67cc10adcb091b4fa1db84b3c57edfd9845075..ebbb9e435a07de0a83bfc41a54cf5e55a470f90f 100644 (file)
@@ -537,7 +537,7 @@ class DifficultParametersTest(fixtures.TestBase):
             t.c[name].in_(["some name", "some other_name"])
         )
 
-        row = connection.execute(stmt).first()
+        connection.execute(stmt).first()
 
     @testing.fixture
     def multirow_fixture(self, metadata, connection):
@@ -621,7 +621,7 @@ class ReturningGuardsTest(fixtures.TablesTest):
                         f"current server capabilities does not support "
                         f".*RETURNING when executemany is used",
                     ):
-                        result = connection.execute(
+                        connection.execute(
                             stmt,
                             [
                                 {id_param_name: 1, "data": "d1"},
index faafe7dc578ac54a0cdd4f2320772291410fe678..5cf860c6a07a63210335c42c976c6361c2fd877f 100644 (file)
@@ -460,7 +460,7 @@ class QuotedNameArgumentTest(fixtures.TablesTest):
             is_true(isinstance(res, dict))
         else:
             with expect_raises(NotImplementedError):
-                res = insp.get_table_options(name)
+                insp.get_table_options(name)
 
     @quote_fixtures
     @testing.requires.view_column_reflection
@@ -2048,7 +2048,7 @@ class ComponentReflectionTest(ComparesTables, OneConnectionTablesTest):
             is_true(isinstance(res, dict))
         else:
             with expect_raises(NotImplementedError):
-                res = insp.get_table_options("users", schema=schema)
+                insp.get_table_options("users", schema=schema)
 
     @testing.combinations((True, testing.requires.schemas), False)
     def test_multi_get_table_options(self, use_schema):
@@ -2064,7 +2064,7 @@ class ComponentReflectionTest(ComparesTables, OneConnectionTablesTest):
             eq_(res, exp)
         else:
             with expect_raises(NotImplementedError):
-                res = insp.get_multi_table_options()
+                insp.get_multi_table_options()
 
     @testing.fixture
     def get_multi_exp(self, connection):
index 79a371d88b29bb4a697e6446ad6758bda032db34..6b21bb67fe2dfca9c4578f1b622503cc379b7c1c 100644 (file)
@@ -1780,7 +1780,7 @@ class IdentityAutoincrementTest(fixtures.TablesTest):
         )
 
     def test_autoincrement_with_identity(self, connection):
-        res = connection.execute(self.tables.tbl.insert(), {"desc": "row"})
+        connection.execute(self.tables.tbl.insert(), {"desc": "row"})
         res = connection.execute(self.tables.tbl.select()).first()
         eq_(res, (1, "row"))