]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
remove unnecessary string concat in same line
authorFederico Caselli <cfederico87@gmail.com>
Tue, 6 Feb 2024 18:44:47 +0000 (19:44 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Tue, 6 Feb 2024 18:44:59 +0000 (19:44 +0100)
manually update the files to remove literal string concat on the same line,
since black does not seem to be making progress in handling these

Change-Id: I3c651374c5f3db5b8bc0c700328d67ca03743b7b
(cherry picked from commit 3fbbe8d67b8b193dcf715905392b1c8f33e68f35)

58 files changed:
doc/build/changelog/migration_11.rst
doc/build/orm/join_conditions.rst
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/engine/cursor.py
lib/sqlalchemy/ext/associationproxy.py
lib/sqlalchemy/inspection.py
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/default_comparator.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/testing/plugin/plugin_base.py
lib/sqlalchemy/testing/suite/test_rowcount.py
lib/sqlalchemy/util/langhelpers.py
test/dialect/mssql/test_compiler.py
test/dialect/mssql/test_query.py
test/dialect/mysql/test_compiler.py
test/dialect/mysql/test_types.py
test/dialect/oracle/test_compiler.py
test/dialect/oracle/test_dialect.py
test/dialect/postgresql/test_compiler.py
test/dialect/postgresql/test_dialect.py
test/dialect/postgresql/test_query.py
test/dialect/test_sqlite.py
test/engine/test_parseconnect.py
test/engine/test_transaction.py
test/orm/declarative/test_basic.py
test/orm/declarative/test_mixin.py
test/orm/dml/test_bulk.py
test/orm/inheritance/test_basic.py
test/orm/test_bind.py
test/orm/test_core_compilation.py
test/orm/test_cycles.py
test/orm/test_deprecations.py
test/orm/test_events.py
test/orm/test_mapper.py
test/orm/test_options.py
test/orm/test_query.py
test/orm/test_selectin_relations.py
test/orm/test_unitofwork.py
test/orm/test_unitofworkv2.py
test/perf/orm2010.py
test/requirements.py
test/sql/test_compiler.py
test/sql/test_constraints.py
test/sql/test_cte.py
test/sql/test_deprecations.py
test/sql/test_external_traversal.py
test/sql/test_insert.py
test/sql/test_lambdas.py
test/sql/test_metadata.py
test/sql/test_operators.py
test/sql/test_quote.py
test/sql/test_resultset.py
test/sql/test_text.py
test/sql/test_types.py

index 8a1ba3ba0e65cae662f6705247d4bf244f31a677..15ef6fcd0c71128097c31d6a81bddab990966048 100644 (file)
@@ -2129,7 +2129,7 @@ table to an integer "id" column on the other::
         pets = relationship(
             "Pets",
             primaryjoin=(
-                "foreign(Pets.person_id)" "==cast(type_coerce(Person.id, Integer), Integer)"
+                "foreign(Pets.person_id)==cast(type_coerce(Person.id, Integer), Integer)"
             ),
         )
 
index a4a905c74cc82455a8d029955acd099bd3b62c9a..5846b5d206f3ec7a2f88424ce4bfb3a9e2352cc7 100644 (file)
@@ -142,7 +142,7 @@ load those ``Address`` objects which specify a city of "Boston"::
         name = mapped_column(String)
         boston_addresses = relationship(
             "Address",
-            primaryjoin="and_(User.id==Address.user_id, " "Address.city=='Boston')",
+            primaryjoin="and_(User.id==Address.user_id, Address.city=='Boston')",
         )
 
 
@@ -297,7 +297,7 @@ a :func:`_orm.relationship`::
 
         network = relationship(
             "Network",
-            primaryjoin="IPA.v4address.bool_op('<<')" "(foreign(Network.v4representation))",
+            primaryjoin="IPA.v4address.bool_op('<<')(foreign(Network.v4representation))",
             viewonly=True,
         )
 
@@ -702,7 +702,7 @@ join condition (requires version 0.9.2 at least to function as is)::
 
         d = relationship(
             "D",
-            secondary="join(B, D, B.d_id == D.id)." "join(C, C.d_id == D.id)",
+            secondary="join(B, D, B.d_id == D.id).join(C, C.d_id == D.id)",
             primaryjoin="and_(A.b_id == B.id, A.id == C.a_id)",
             secondaryjoin="D.id == B.d_id",
             uselist=False,
index a6a813841547b41f930586812f994ad066b9698c..a548b3449976f61a79330787f7765e1c3ad7ab10 100644 (file)
@@ -594,7 +594,7 @@ RESERVED_WORDS = set(
 )
 
 NO_ARG_FNS = set(
-    "UID CURRENT_DATE SYSDATE USER " "CURRENT_TIME CURRENT_TIMESTAMP".split()
+    "UID CURRENT_DATE SYSDATE USER CURRENT_TIME CURRENT_TIMESTAMP".split()
 )
 
 
index c9390a9f11db125c77c757c20932e95ecd8c7f57..4b18ddb434098cd77f442675111082c443416d0f 100644 (file)
@@ -1611,11 +1611,11 @@ class CursorResult(Result[_T]):
         """
         if not self.context.compiled:
             raise exc.InvalidRequestError(
-                "Statement is not a compiled " "expression construct."
+                "Statement is not a compiled expression construct."
             )
         elif not self.context.isinsert:
             raise exc.InvalidRequestError(
-                "Statement is not an insert() " "expression construct."
+                "Statement is not an insert() expression construct."
             )
         elif self.context._is_explicit_returning:
             raise exc.InvalidRequestError(
@@ -1682,11 +1682,11 @@ class CursorResult(Result[_T]):
         """
         if not self.context.compiled:
             raise exc.InvalidRequestError(
-                "Statement is not a compiled " "expression construct."
+                "Statement is not a compiled expression construct."
             )
         elif not self.context.isupdate:
             raise exc.InvalidRequestError(
-                "Statement is not an update() " "expression construct."
+                "Statement is not an update() expression construct."
             )
         elif self.context.executemany:
             return self.context.compiled_parameters
@@ -1704,11 +1704,11 @@ class CursorResult(Result[_T]):
         """
         if not self.context.compiled:
             raise exc.InvalidRequestError(
-                "Statement is not a compiled " "expression construct."
+                "Statement is not a compiled expression construct."
             )
         elif not self.context.isinsert:
             raise exc.InvalidRequestError(
-                "Statement is not an insert() " "expression construct."
+                "Statement is not an insert() expression construct."
             )
         elif self.context.executemany:
             return self.context.compiled_parameters
@@ -1921,7 +1921,7 @@ class CursorResult(Result[_T]):
 
         if not self.context.compiled:
             raise exc.InvalidRequestError(
-                "Statement is not a compiled " "expression construct."
+                "Statement is not a compiled expression construct."
             )
         elif not self.context.isinsert and not self.context.isupdate:
             raise exc.InvalidRequestError(
@@ -1944,7 +1944,7 @@ class CursorResult(Result[_T]):
 
         if not self.context.compiled:
             raise exc.InvalidRequestError(
-                "Statement is not a compiled " "expression construct."
+                "Statement is not a compiled expression construct."
             )
         elif not self.context.isinsert and not self.context.isupdate:
             raise exc.InvalidRequestError(
index 86043ba7992845c9f2491e31054f04fd716917e1..80e6fdac987cad0b8ace847411ba3ded5233fd67 100644 (file)
@@ -1074,7 +1074,7 @@ class AssociationProxyInstance(SQLORMOperations[_T]):
             and (not self._target_is_object or self._value_is_scalar)
         ):
             raise exc.InvalidRequestError(
-                "'any()' not implemented for scalar " "attributes. Use has()."
+                "'any()' not implemented for scalar attributes. Use has()."
             )
         return self._criterion_exists(
             criterion=criterion, is_has=False, **kwargs
@@ -1098,7 +1098,7 @@ class AssociationProxyInstance(SQLORMOperations[_T]):
             or (self._target_is_object and not self._value_is_scalar)
         ):
             raise exc.InvalidRequestError(
-                "'has()' not implemented for collections.  " "Use any()."
+                "'has()' not implemented for collections. Use any()."
             )
         return self._criterion_exists(
             criterion=criterion, is_has=True, **kwargs
index 4ee48f3851778406094dfd766742af96aac48930..30d531957f81ca88a411a7301481f4ba7b756659 100644 (file)
@@ -157,9 +157,7 @@ def _inspects(
     def decorate(fn_or_cls: _F) -> _F:
         for type_ in types:
             if type_ in _registrars:
-                raise AssertionError(
-                    "Type %s is already " "registered" % type_
-                )
+                raise AssertionError("Type %s is already registered" % type_)
             _registrars[type_] = fn_or_cls
         return fn_or_cls
 
@@ -171,6 +169,6 @@ _TT = TypeVar("_TT", bound="Type[Any]")
 
 def _self_inspects(cls: _TT) -> _TT:
     if cls in _registrars:
-        raise AssertionError("Type %s is already " "registered" % cls)
+        raise AssertionError("Type %s is already registered" % cls)
     _registrars[cls] = True
     return cls
index 68a6f6453178ed6df19890812169ed9d8d485ac6..2f090588fe687ba4e2fe9814045d944b4bccb4d7 100644 (file)
@@ -115,7 +115,7 @@ _TLS = TypeVar("_TLS", bound="Type[LoaderStrategy]")
 class ORMStatementRole(roles.StatementRole):
     __slots__ = ()
     _role_name = (
-        "Executable SQL or text() construct, including ORM " "aware objects"
+        "Executable SQL or text() construct, including ORM aware objects"
     )
 
 
index db76bd912f741d570021107e324d2d97099317f8..11ea5911279d74a96091335e2bce16ebaca0ccfa 100644 (file)
@@ -951,7 +951,7 @@ class RelationshipProperty(
             """
             if self.property.uselist:
                 raise sa_exc.InvalidRequestError(
-                    "'has()' not implemented for collections.  " "Use any()."
+                    "'has()' not implemented for collections. Use any()."
                 )
             return self._criterion_exists(criterion, **kwargs)
 
index e38a05f06135fcd6c9df0fe541983081f4b5cd31..20c3b9cc6b01369e00671a38678023c7089a91bb 100644 (file)
@@ -384,7 +384,7 @@ class DeferredColumnLoader(LoaderStrategy):
         super().__init__(parent, strategy_key)
         if hasattr(self.parent_property, "composite_class"):
             raise NotImplementedError(
-                "Deferred loading for composite " "types not implemented yet"
+                "Deferred loading for composite types not implemented yet"
             )
         self.raiseload = self.strategy_opts.get("raiseload", False)
         self.columns = self.parent_property.columns
@@ -758,7 +758,7 @@ class LazyLoader(
                         self._equated_columns[c] = self._equated_columns[col]
 
             self.logger.info(
-                "%s will use Session.get() to " "optimize instance loads", self
+                "%s will use Session.get() to optimize instance loads", self
             )
 
     def init_class_attribute(self, mapper):
index c6102098a6a9ab5f37c462f50f3f968b7c7f3927..90508206ee62bd1ead06732474a42ea8cea02a9f 100644 (file)
@@ -256,9 +256,7 @@ class CascadeOptions(FrozenSet[str]):
         self.delete_orphan = "delete-orphan" in values
 
         if self.delete_orphan and not self.delete:
-            util.warn(
-                "The 'delete-orphan' cascade " "option requires 'delete'."
-            )
+            util.warn("The 'delete-orphan' cascade option requires 'delete'.")
         return self
 
     def __repr__(self):
index 064be4dfdf3608d2914a60f5e480007c9d41d384..ba8e3ea450b6c1bc7d2b59d36169acb1a3daad41 100644 (file)
@@ -2532,7 +2532,7 @@ class SQLCompiler(Compiled):
 
     def _fallback_column_name(self, column):
         raise exc.CompileError(
-            "Cannot compile Column object until " "its 'name' is assigned."
+            "Cannot compile Column object until its 'name' is assigned."
         )
 
     def visit_lambda_element(self, element, **kw):
@@ -6638,7 +6638,7 @@ class DDLCompiler(Compiled):
     def _verify_index_table(self, index):
         if index.table is None:
             raise exc.CompileError(
-                "Index '%s' is not associated " "with any table." % index.name
+                "Index '%s' is not associated with any table." % index.name
             )
 
     def visit_create_index(
index 5bf8d582e5383ea627977726db59ac904a060886..76131bcaa45e79dda102e88fb43bb554e0c06310 100644 (file)
@@ -247,7 +247,7 @@ def _unsupported_impl(
     expr: ColumnElement[Any], op: OperatorType, *arg: Any, **kw: Any
 ) -> NoReturn:
     raise NotImplementedError(
-        "Operator '%s' is not supported on " "this expression" % op.__name__
+        "Operator '%s' is not supported on this expression" % op.__name__
     )
 
 
index 96e350447a8fd1a1579d5931a0df6e9ae9e065fa..2932fffad471f47a78ff96c6c3ac1d5586428978 100644 (file)
@@ -2063,7 +2063,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]):
             name = quoted_name(name, quote)
         elif quote is not None:
             raise exc.ArgumentError(
-                "Explicit 'name' is required when " "sending 'quote' argument"
+                "Explicit 'name' is required when sending 'quote' argument"
             )
 
         # name = None is expected to be an interim state
index 11eb35cfa9b99d5b9704ebd96057547a8d622037..a642668be936de23f82e96a23538568d5cad8333 100644 (file)
@@ -90,7 +90,7 @@ def setup_options(make_option):
         action="append",
         type=str,
         dest="dburi",
-        help="Database uri.  Multiple OK, " "first one is run by default.",
+        help="Database uri.  Multiple OK, first one is run by default.",
     )
     make_option(
         "--dbdriver",
index c48ed355c914d12a61beee92c2fa7c7e82d603a5..a7dbd364f1b480506ccaabc56550b443b9deade1 100644 (file)
@@ -204,7 +204,7 @@ class RowCountTest(fixtures.TablesTest):
     def test_text_rowcount(self, connection):
         # test issue #3622, make sure eager rowcount is called for text
         result = connection.execute(
-            text("update employees set department='Z' " "where department='C'")
+            text("update employees set department='Z' where department='C'")
         )
         eq_(result.rowcount, 3)
 
index b122a3b35b3a0ba41c5cb6839a3cc70fa7720065..396a039771da1a4b24136650929dba699892e5ec 100644 (file)
@@ -1951,7 +1951,7 @@ NoneType = type(None)
 
 
 def attrsetter(attrname):
-    code = "def set(obj, value):" "    obj.%s = value" % attrname
+    code = "def set(obj, value):    obj.%s = value" % attrname
     env = locals().copy()
     exec(code, env)
     return env["set"]
index b5ea40b120e98e2e30a8ee9c183e09ba1d5b2883..59b13b91e0b5be53616b2cf4f449ec366d16bd02 100644 (file)
@@ -175,7 +175,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         t = table("sometable", column("somecolumn"))
         self.assert_compile(
             t.insert(),
-            "INSERT INTO sometable (somecolumn) VALUES " "(:somecolumn)",
+            "INSERT INTO sometable (somecolumn) VALUES (:somecolumn)",
         )
 
     def test_update(self):
@@ -862,7 +862,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             tbl.delete().where(tbl.c.id == 1),
-            "DELETE FROM paj.test WHERE paj.test.id = " ":id_1",
+            "DELETE FROM paj.test WHERE paj.test.id = :id_1",
         )
         s = select(tbl.c.id).where(tbl.c.id == 1)
         self.assert_compile(
@@ -882,7 +882,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             tbl.delete().where(tbl.c.id == 1),
-            "DELETE FROM banana.paj.test WHERE " "banana.paj.test.id = :id_1",
+            "DELETE FROM banana.paj.test WHERE banana.paj.test.id = :id_1",
         )
         s = select(tbl.c.id).where(tbl.c.id == 1)
         self.assert_compile(
@@ -999,7 +999,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             select(func.max(t.c.col1)),
-            "SELECT max(sometable.col1) AS max_1 FROM " "sometable",
+            "SELECT max(sometable.col1) AS max_1 FROM sometable",
         )
 
     def test_function_overrides(self):
@@ -1072,7 +1072,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         d = delete(table1).returning(table1.c.myid, table1.c.name)
         self.assert_compile(
-            d, "DELETE FROM mytable OUTPUT deleted.myid, " "deleted.name"
+            d, "DELETE FROM mytable OUTPUT deleted.myid, deleted.name"
         )
         d = (
             delete(table1)
@@ -1945,7 +1945,7 @@ class CompileIdentityTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             schema.CreateTable(tbl),
-            "CREATE TABLE test (id INTEGER NOT NULL IDENTITY(3,1)" ")",
+            "CREATE TABLE test (id INTEGER NOT NULL IDENTITY(3,1))",
         )
 
     def test_identity_separate_from_primary_key(self):
index b68b21339ea9a487eda6ef17feab74d0513c71b2..33f648b82a0f0765bdcb8a592595432756bfaf3b 100644 (file)
@@ -664,7 +664,7 @@ RETURN
     def test_scalar_strings_named_control(self, scalar_strings, connection):
         result = (
             connection.exec_driver_sql(
-                "SELECT anon_1.my_string " "FROM scalar_strings() AS anon_1"
+                "SELECT anon_1.my_string FROM scalar_strings() AS anon_1"
             )
             .scalars()
             .all()
index 05b4b685427b4faa2d775093d11409825c838f25..6712300aa40cd00bad4ea14b1ad2718dd1db2966 100644 (file)
@@ -182,7 +182,7 @@ class CompileTest(ReservedWordFixture, fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             schema.CreateIndex(idx),
-            "CREATE FULLTEXT INDEX test_idx1 " "ON testtbl (data(10))",
+            "CREATE FULLTEXT INDEX test_idx1 ON testtbl (data(10))",
         )
 
     def test_create_index_with_text(self):
@@ -876,7 +876,7 @@ class SQLTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             schema.CreateIndex(ix1),
-            "CREATE INDEX %s " "ON %s (%s)" % (exp, tname, cname),
+            "CREATE INDEX %s ON %s (%s)" % (exp, tname, cname),
         )
 
     def test_innodb_autoincrement(self):
index 1d279e720db6480ebad6a82083e7c5be505f1a50..c73e82a945b9f1a26fb3160facf59f2f9a2c1c99 100644 (file)
@@ -385,7 +385,7 @@ class TypeCompileTest(fixtures.TestBase, AssertsCompiledSQL):
                 mysql.MSTimeStamp(),
                 DefaultClause(
                     sql.text(
-                        "'1999-09-09 09:09:09' " "ON UPDATE CURRENT_TIMESTAMP"
+                        "'1999-09-09 09:09:09' ON UPDATE CURRENT_TIMESTAMP"
                     )
                 ),
             ],
@@ -398,7 +398,7 @@ class TypeCompileTest(fixtures.TestBase, AssertsCompiledSQL):
                 mysql.MSTimeStamp,
                 DefaultClause(
                     sql.text(
-                        "'1999-09-09 09:09:09' " "ON UPDATE CURRENT_TIMESTAMP"
+                        "'1999-09-09 09:09:09' ON UPDATE CURRENT_TIMESTAMP"
                     )
                 ),
             ],
@@ -410,9 +410,7 @@ class TypeCompileTest(fixtures.TestBase, AssertsCompiledSQL):
             [
                 mysql.MSTimeStamp(),
                 DefaultClause(
-                    sql.text(
-                        "CURRENT_TIMESTAMP " "ON UPDATE CURRENT_TIMESTAMP"
-                    )
+                    sql.text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
                 ),
             ],
             {},
@@ -423,9 +421,7 @@ class TypeCompileTest(fixtures.TestBase, AssertsCompiledSQL):
             [
                 mysql.MSTimeStamp,
                 DefaultClause(
-                    sql.text(
-                        "CURRENT_TIMESTAMP " "ON UPDATE CURRENT_TIMESTAMP"
-                    )
+                    sql.text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
                 ),
             ],
             {"nullable": False},
@@ -1209,7 +1205,7 @@ class EnumSetTest(
         t1 = Table("sometable", MetaData(), Column("somecolumn", e1))
         self.assert_compile(
             schema.CreateTable(t1),
-            "CREATE TABLE sometable (somecolumn " "ENUM('x','y','z'))",
+            "CREATE TABLE sometable (somecolumn ENUM('x','y','z'))",
         )
         t1 = Table(
             "sometable",
index c7a6858d4cbfc1305e2971e14c4885eebd009fae..2165aa0909d91bca844c970a2097d88ead011e83 100644 (file)
@@ -92,7 +92,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             parent.join(child),
-            "ed.parent JOIN ed.child ON ed.parent.id = " "ed.child.parent_id",
+            "ed.parent JOIN ed.child ON ed.parent.id = ed.child.parent_id",
         )
 
     def test_subquery(self):
@@ -1183,7 +1183,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         q = select(table1.c.name).where(table1.c.name == "foo")
         self.assert_compile(
             q,
-            "SELECT mytable.name FROM mytable WHERE " "mytable.name = :name_1",
+            "SELECT mytable.name FROM mytable WHERE mytable.name = :name_1",
             dialect=oracle.dialect(use_ansi=False),
         )
 
@@ -1498,7 +1498,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             schema.CreateTable(tbl2),
-            "CREATE TABLE testtbl2 (data INTEGER) " "COMPRESS FOR OLTP",
+            "CREATE TABLE testtbl2 (data INTEGER) COMPRESS FOR OLTP",
         )
 
     def test_create_index_bitmap_compress(self):
index 68ee3f7180085c7c6ff2fa6dce3c6a24a8e0bc6a..0c4b894f89dd15d67426c0a1850b80c91c09d48f 100644 (file)
@@ -532,9 +532,7 @@ end;
 
     def test_out_params(self, connection):
         result = connection.execute(
-            text(
-                "begin foo(:x_in, :x_out, :y_out, " ":z_out); end;"
-            ).bindparams(
+            text("begin foo(:x_in, :x_out, :y_out, :z_out); end;").bindparams(
                 bindparam("x_in", Float),
                 outparam("x_out", Integer),
                 outparam("y_out", Float),
@@ -863,7 +861,7 @@ class ExecuteTest(fixtures.TestBase):
         with testing.db.connect() as conn:
             eq_(
                 conn.exec_driver_sql(
-                    "/*+ this is a comment */ SELECT 1 FROM " "DUAL"
+                    "/*+ this is a comment */ SELECT 1 FROM DUAL"
                 ).fetchall(),
                 [(1,)],
             )
index 005e60eaa14fd33eace35613d8c6a3c88b123986..f33c251160e0f80dc7a2751f8f52b893ef273169 100644 (file)
@@ -262,7 +262,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             postgresql.CreateEnumType(e2),
-            "CREATE TYPE someschema.somename AS ENUM " "('x', 'y', 'z')",
+            "CREATE TYPE someschema.somename AS ENUM ('x', 'y', 'z')",
         )
         self.assert_compile(postgresql.DropEnumType(e1), "DROP TYPE somename")
         self.assert_compile(
@@ -271,7 +271,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         t1 = Table("sometable", MetaData(), Column("somecolumn", e1))
         self.assert_compile(
             schema.CreateTable(t1),
-            "CREATE TABLE sometable (somecolumn " "somename)",
+            "CREATE TABLE sometable (somecolumn somename)",
         )
         t1 = Table(
             "sometable",
@@ -682,7 +682,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             schema.CreateIndex(idx),
-            "CREATE INDEX test_idx1 ON testtbl " "(data text_pattern_ops)",
+            "CREATE INDEX test_idx1 ON testtbl (data text_pattern_ops)",
             dialect=postgresql.dialect(),
         )
         self.assert_compile(
@@ -725,7 +725,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
                     unique=True,
                 )
             ),
-            "CREATE UNIQUE INDEX test_idx3 ON test_tbl " "(data3)",
+            "CREATE UNIQUE INDEX test_idx3 ON test_tbl (data3)",
         ),
         (
             lambda tbl: schema.CreateIndex(
@@ -892,17 +892,17 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             schema.CreateIndex(idx1),
-            "CREATE INDEX test_idx1 ON testtbl " "(data)",
+            "CREATE INDEX test_idx1 ON testtbl (data)",
             dialect=postgresql.dialect(),
         )
         self.assert_compile(
             schema.CreateIndex(idx2),
-            "CREATE INDEX test_idx2 ON testtbl " "USING btree (data)",
+            "CREATE INDEX test_idx2 ON testtbl USING btree (data)",
             dialect=postgresql.dialect(),
         )
         self.assert_compile(
             schema.CreateIndex(idx3),
-            "CREATE INDEX test_idx3 ON testtbl " "USING hash (data)",
+            "CREATE INDEX test_idx3 ON testtbl USING hash (data)",
             dialect=postgresql.dialect(),
         )
 
@@ -923,7 +923,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             schema.CreateIndex(idx1),
-            "CREATE INDEX test_idx1 ON testtbl " "(data)",
+            "CREATE INDEX test_idx1 ON testtbl (data)",
         )
         self.assert_compile(
             schema.CreateIndex(idx2),
@@ -946,7 +946,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
             schema.CreateIndex(
                 Index("test_idx1", tbl.c.data, postgresql_using="GIST")
             ),
-            "CREATE INDEX test_idx1 ON testtbl " "USING gist (data)",
+            "CREATE INDEX test_idx1 ON testtbl USING gist (data)",
         )
 
         self.assert_compile(
@@ -988,7 +988,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             schema.CreateIndex(idx1),
-            "CREATE INDEX test_idx1 ON testtbl " "(data)",
+            "CREATE INDEX test_idx1 ON testtbl (data)",
             dialect=postgresql.dialect(),
         )
         self.assert_compile(
@@ -2083,7 +2083,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         # default dialect does not, as DBAPIs may be doing this for us
         self.assert_compile(
             t.update().values({t.c.data[2:5]: [2, 3, 4]}),
-            "UPDATE t SET data[%s:%s]=" "%s",
+            "UPDATE t SET data[%s:%s]=%s",
             checkparams={"param_1": [2, 3, 4], "data_2": 5, "data_1": 2},
             dialect=PGDialect(paramstyle="format"),
         )
@@ -2139,7 +2139,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
         tbl3 = Table("testtbl3", m, Column("id", Integer), schema="testschema")
         stmt = tbl3.select().with_hint(tbl3, "ONLY", "postgresql")
         expected = (
-            "SELECT testschema.testtbl3.id FROM " "ONLY testschema.testtbl3"
+            "SELECT testschema.testtbl3.id FROM ONLY testschema.testtbl3"
         )
         self.assert_compile(stmt, expected)
 
@@ -3296,7 +3296,7 @@ class DistinctOnTest(fixtures.MappedTest, AssertsCompiledSQL):
         sess = Session()
         self.assert_compile(
             sess.query(self.table).distinct(),
-            "SELECT DISTINCT t.id AS t_id, t.a AS t_a, " "t.b AS t_b FROM t",
+            "SELECT DISTINCT t.id AS t_id, t.a AS t_a, t.b AS t_b FROM t",
         )
 
     def test_query_on_columns(self):
index 919842a49c4244d7014b18352535eeda1d768ab5..32a5a84ac8dc73ba801f81ff8ee400026f6df64d 100644 (file)
@@ -721,7 +721,7 @@ class MultiHostConnectTest(fixtures.TestBase):
             "postgresql+psycopg2://USER:PASS@/DB"
             "?host=hostA,hostC&port=111,222,333",
         ),
-        ("postgresql+psycopg2://USER:PASS@/DB" "?host=hostA&port=111,222",),
+        ("postgresql+psycopg2://USER:PASS@/DB?host=hostA&port=111,222",),
         (
             "postgresql+asyncpg://USER:PASS@/DB"
             "?host=hostA,hostB,hostC&port=111,333",
index 9822b3e60b95c5f95adcbd2b424b4dc398d9eda0..a737381760e77351c7d315176b8516372810efbc 100644 (file)
@@ -977,7 +977,7 @@ class MatchTest(fixtures.TablesTest, AssertsCompiledSQL):
         if self._strs_render_bind_casts(connection):
             self.assert_compile(
                 matchtable.c.title.match("somstr"),
-                "matchtable.title @@ " "plainto_tsquery(%(title_1)s::VARCHAR)",
+                "matchtable.title @@ plainto_tsquery(%(title_1)s::VARCHAR)",
             )
         else:
             self.assert_compile(
index d5ff0fc19de64b4708e690dd13e7a9af90a948c5..245b762cf373c6f5ed4428906adbf28df028d37e 100644 (file)
@@ -84,12 +84,12 @@ class TestTypes(fixtures.TestBase, AssertsExecutionResults):
         )
         metadata.create_all(connection)
         for stmt in [
-            "INSERT INTO bool_table (id, boo) " "VALUES (1, 'false');",
-            "INSERT INTO bool_table (id, boo) " "VALUES (2, 'true');",
-            "INSERT INTO bool_table (id, boo) " "VALUES (3, '1');",
-            "INSERT INTO bool_table (id, boo) " "VALUES (4, '0');",
-            "INSERT INTO bool_table (id, boo) " "VALUES (5, 1);",
-            "INSERT INTO bool_table (id, boo) " "VALUES (6, 0);",
+            "INSERT INTO bool_table (id, boo) VALUES (1, 'false');",
+            "INSERT INTO bool_table (id, boo) VALUES (2, 'true');",
+            "INSERT INTO bool_table (id, boo) VALUES (3, '1');",
+            "INSERT INTO bool_table (id, boo) VALUES (4, '0');",
+            "INSERT INTO bool_table (id, boo) VALUES (5, 1);",
+            "INSERT INTO bool_table (id, boo) VALUES (6, 0);",
         ]:
             connection.exec_driver_sql(stmt)
 
@@ -653,7 +653,7 @@ class DialectTest(
 
     @testing.provide_metadata
     def test_quoted_identifiers_functional_two(self):
-        """ "test the edgiest of edge cases, quoted table/col names
+        """test the edgiest of edge cases, quoted table/col names
         that start and end with quotes.
 
         SQLite claims to have fixed this in
@@ -741,7 +741,7 @@ class DialectTest(
             ),
         ),
         (
-            "sqlite:///file:path/to/database?" "mode=ro&uri=true",
+            "sqlite:///file:path/to/database?mode=ro&uri=true",
             (
                 ["file:path/to/database?mode=ro"],
                 {"uri": True, "check_same_thread": False},
@@ -1155,7 +1155,7 @@ class OnConflictDDLTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             schema.CreateColumn(c),
-            "test INTEGER NOT NULL " "ON CONFLICT FAIL",
+            "test INTEGER NOT NULL ON CONFLICT FAIL",
             dialect=sqlite.dialect(),
         )
 
@@ -1194,7 +1194,7 @@ class OnConflictDDLTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             CreateTable(t),
-            "CREATE TABLE n (x VARCHAR(30), " "UNIQUE (x) ON CONFLICT FAIL)",
+            "CREATE TABLE n (x VARCHAR(30), UNIQUE (x) ON CONFLICT FAIL)",
             dialect=sqlite.dialect(),
         )
 
index 34dc1d7aa82833786392c58e46183c0ee5b0f749..16b129fd8a38af38e8199230450fe9ed7c8a39af 100644 (file)
@@ -373,7 +373,7 @@ class URLTest(fixtures.TestBase):
         (
             "foo1=bar1&foo2=bar21&foo2=bar22&foo3=bar31",
             "foo2=bar23&foo3=bar32&foo3=bar33",
-            "foo1=bar1&foo2=bar23&" "foo3=bar32&foo3=bar33",
+            "foo1=bar1&foo2=bar23&foo3=bar32&foo3=bar33",
             False,
         ),
     )
@@ -573,7 +573,7 @@ class CreateEngineTest(fixtures.TestBase):
         e = engine_from_config(config, module=dbapi, _initialize=False)
         assert e.pool._recycle == 50
         assert e.url == url.make_url(
-            "postgresql+psycopg2://scott:tiger@somehost/test?foo" "z=somevalue"
+            "postgresql+psycopg2://scott:tiger@somehost/test?fooz=somevalue"
         )
         assert e.echo is True
 
index 4ae87c4ad18940ed5002b1fd3859657a28009467..a70e8e05d0fe2f480dba2a0e6135a8e82bfc8059 100644 (file)
@@ -345,9 +345,7 @@ class TransactionTest(fixtures.TablesTest):
         assert not trans.is_active
 
         eq_(
-            connection.exec_driver_sql(
-                "select count(*) from " "users"
-            ).scalar(),
+            connection.exec_driver_sql("select count(*) from users").scalar(),
             2,
         )
         connection.rollback()
index 37a1b643c1d919722d71e433f2166cb031c87c8e..1f31544e06527a02997a149dbc056ce80af13493 100644 (file)
@@ -1387,7 +1387,7 @@ class DeclarativeMultiBaseTest(
 
         assert_raises_message(
             sa.exc.ArgumentError,
-            "Can't add additional column 'foo' when " "specifying __table__",
+            "Can't add additional column 'foo' when specifying __table__",
             go,
         )
 
@@ -1825,7 +1825,7 @@ class DeclarativeMultiBaseTest(
 
         assert_raises_message(
             exc.InvalidRequestError,
-            "'addresses' is not an instance of " "ColumnProperty",
+            "'addresses' is not an instance of ColumnProperty",
             configure_mappers,
         )
 
@@ -1954,7 +1954,7 @@ class DeclarativeMultiBaseTest(
 
         assert_raises_message(
             AttributeError,
-            "does not have a mapped column named " "'__table__'",
+            "does not have a mapped column named '__table__'",
             configure_mappers,
         )
 
@@ -2508,7 +2508,7 @@ class DeclarativeMultiBaseTest(
 
     def test_oops(self):
         with testing.expect_warnings(
-            "Ignoring declarative-like tuple value of " "attribute 'name'"
+            "Ignoring declarative-like tuple value of attribute 'name'"
         ):
 
             class User(Base, ComparableEntity):
index 32f737484e20f4a9ef30202a832f06a57b03ffe9..2520eb846d73fa0151383fab6494954fe0dd02ad 100644 (file)
@@ -1322,7 +1322,7 @@ class DeclarativeMixinTest(DeclarativeTestBase):
 
         assert_raises_message(
             sa.exc.ArgumentError,
-            "Can't add additional column 'tada' when " "specifying __table__",
+            "Can't add additional column 'tada' when specifying __table__",
             go,
         )
 
index baa6c20f83f9c33533122337f281dd7a744b86de..62b435e9cbfe8e0d24adcd508c30b10180f98848 100644 (file)
@@ -238,7 +238,7 @@ class BulkInsertUpdateTest(BulkTest, _fixtures.FixtureTest):
 
         asserter.assert_(
             CompiledSQL(
-                "UPDATE users SET name=:name WHERE " "users.id = :users_id",
+                "UPDATE users SET name=:name WHERE users.id = :users_id",
                 [
                     {"users_id": 1, "name": "u1new"},
                     {"users_id": 2, "name": "u2"},
index a76f563f8188f0561979884338a6b0c350558305..9028fd25a43012397fe1e6afb7315f48f94f9a7a 100644 (file)
@@ -1684,7 +1684,7 @@ class PassiveDeletesTest(fixtures.MappedTest):
             s.flush()
         asserter.assert_(
             RegexSQL(
-                "SELECT .* " "FROM c WHERE :param_1 = c.bid", [{"param_1": 3}]
+                "SELECT .* FROM c WHERE :param_1 = c.bid", [{"param_1": 3}]
             ),
             CompiledSQL("DELETE FROM c WHERE c.cid = :cid", [{"cid": 1}]),
             CompiledSQL("DELETE FROM b WHERE b.id = :id", [{"id": 3}]),
@@ -3012,7 +3012,7 @@ class OptimizedLoadTest(fixtures.MappedTest):
         )
 
     def test_optimized_passes(self):
-        """ "test that the 'optimized load' routine doesn't crash when
+        """test that the 'optimized load' routine doesn't crash when
         a column in the join condition is not available."""
 
         base, sub = self.tables.base, self.tables.sub
@@ -3744,7 +3744,7 @@ class NoPolyIdentInMiddleTest(fixtures.MappedTest):
             __mapper_args__ = {"polymorphic_identity": "b"}
 
         with expect_warnings(
-            r"Mapper\[C\(a\)\] does not indicate a " "'polymorphic_identity',"
+            r"Mapper\[C\(a\)\] does not indicate a 'polymorphic_identity',"
         ):
 
             class C(A):
index 976df514f3b3b08f23351b12eb4ed94433cfb8e5..abd008cadf08859c3582c0321264f6154945c465 100644 (file)
@@ -464,7 +464,7 @@ class BindIntegrationTest(_fixtures.FixtureTest):
         engine = {"e1": e1, "e2": e2, "e3": e3}[expected_engine_name]
 
         with mock.patch(
-            "sqlalchemy.orm.context." "ORMCompileState.orm_setup_cursor_result"
+            "sqlalchemy.orm.context.ORMCompileState.orm_setup_cursor_result"
         ), mock.patch(
             "sqlalchemy.orm.context.ORMCompileState.orm_execute_statement"
         ), mock.patch(
@@ -529,7 +529,7 @@ class BindIntegrationTest(_fixtures.FixtureTest):
 
         assert_raises_message(
             sa.exc.InvalidRequestError,
-            "Session already has a Connection " "associated",
+            "Session already has a Connection associated",
             transaction._connection_for_bind,
             testing.db.connect(),
             None,
index dd0d597b225108f7f81d73c6c90c9ed6e5ee1280..915c9747f8f87ed5916c0deca60204494dbd4a0e 100644 (file)
@@ -555,7 +555,7 @@ class DMLTest(QueryTest, AssertsCompiledSQL):
 
         self.assert_compile(
             stmt,
-            "DELETE FROM users AS users_1 " "WHERE users_1.name = :name_1",
+            "DELETE FROM users AS users_1 WHERE users_1.name = :name_1",
         )
 
     @testing.variation("stmt_type", ["core", "orm"])
index cffde9bdab9c8ae69faf519e810b912a21d4520b..fb37185f53e3c3437389fa8c57b099480b9e69b1 100644 (file)
@@ -1188,7 +1188,7 @@ class OneToManyManyToOneTest(fixtures.MappedTest):
                 ],
             ),
             CompiledSQL(
-                "DELETE FROM person " "WHERE person.id = :id",
+                "DELETE FROM person WHERE person.id = :id",
                 lambda ctx: [{"id": p.id}],
             ),
             CompiledSQL(
index f943d8dfe42f2bdf6a58cc592537a4362aedcfdc..bf545d6ad99d4ec04ae6fae3553c4ee1206b74fb 100644 (file)
@@ -1995,7 +1995,7 @@ class MixedEntitiesTest(QueryTest, AssertsCompiledSQL):
 
     @testing.fails_on("mssql", "FIXME: unknown")
     @testing.fails_on(
-        "oracle", "Oracle doesn't support boolean expressions as " "columns"
+        "oracle", "Oracle doesn't support boolean expressions as columns"
     )
     @testing.fails_on(
         "postgresql+pg8000",
index 02e00fe94793c3a8b72a8f61732b50be9064296a..3af6aad86aae9eb5bfacc81e53d5cf970da3a32f 100644 (file)
@@ -1671,7 +1671,7 @@ class DeclarativeEventListenTest(
 
 
 class DeferredMapperEventsTest(RemoveORMEventsGlobally, _fixtures.FixtureTest):
-    """ "test event listeners against unmapped classes.
+    """test event listeners against unmapped classes.
 
     This incurs special logic.  Note if we ever do the "remove" case,
     it has to get all of these, too.
index f93c18d2161a60a6ec3936773ced282458cc8119..64d0ac9abde633fe04b897f34d278702dbc1977b 100644 (file)
@@ -3483,7 +3483,7 @@ class ConfigureOrNotConfigureTest(_fixtures.FixtureTest, AssertsCompiledSQL):
 
         self.assert_compile(
             stmt,
-            "SELECT users.id, " "users.name " "FROM users",
+            "SELECT users.id, users.name FROM users",
         )
         is_true(um.configured)
 
index 9362d52470e6cf56371dcae883d338a2d5149e1f..db9b51607c3ab3e0440a1974e1d30ad364e522e1 100644 (file)
@@ -981,7 +981,7 @@ class OptionsNoPropTest(_fixtures.FixtureTest):
                 if first_element
                 else (Load(Item).joinedload(Keyword),)
             ),
-            "expected ORM mapped attribute for loader " "strategy argument",
+            "expected ORM mapped attribute for loader strategy argument",
         )
 
     @testing.combinations(
index a06406c11542a5d478734c86aa908efeb8b5a25e..ea108c345b033bacb65bbd127b18537fe96ea2db 100644 (file)
@@ -3563,7 +3563,7 @@ class FilterTest(QueryTest, AssertsCompiledSQL):
 
         self.assert_compile(
             q1,
-            "SELECT users.id AS foo FROM users " "WHERE users.name = :name_1",
+            "SELECT users.id AS foo FROM users WHERE users.name = :name_1",
         )
 
     def test_empty_filters(self):
@@ -4348,7 +4348,7 @@ class ExistsTest(QueryTest, AssertsCompiledSQL):
         q1 = sess.query(User)
         self.assert_compile(
             sess.query(q1.exists()),
-            "SELECT EXISTS (" "SELECT 1 FROM users" ") AS anon_1",
+            "SELECT EXISTS (SELECT 1 FROM users) AS anon_1",
         )
 
         q2 = sess.query(User).filter(User.name == "fred")
@@ -4366,7 +4366,7 @@ class ExistsTest(QueryTest, AssertsCompiledSQL):
         q1 = sess.query(User.id)
         self.assert_compile(
             sess.query(q1.exists()),
-            "SELECT EXISTS (" "SELECT 1 FROM users" ") AS anon_1",
+            "SELECT EXISTS (SELECT 1 FROM users) AS anon_1",
         )
 
     def test_exists_labeled_col_expression(self):
@@ -4376,7 +4376,7 @@ class ExistsTest(QueryTest, AssertsCompiledSQL):
         q1 = sess.query(User.id.label("foo"))
         self.assert_compile(
             sess.query(q1.exists()),
-            "SELECT EXISTS (" "SELECT 1 FROM users" ") AS anon_1",
+            "SELECT EXISTS (SELECT 1 FROM users) AS anon_1",
         )
 
     def test_exists_arbitrary_col_expression(self):
@@ -4386,7 +4386,7 @@ class ExistsTest(QueryTest, AssertsCompiledSQL):
         q1 = sess.query(func.foo(User.id))
         self.assert_compile(
             sess.query(q1.exists()),
-            "SELECT EXISTS (" "SELECT 1 FROM users" ") AS anon_1",
+            "SELECT EXISTS (SELECT 1 FROM users) AS anon_1",
         )
 
     def test_exists_col_warning(self):
@@ -5178,7 +5178,7 @@ class PrefixSuffixWithTest(QueryTest, AssertsCompiledSQL):
         User = self.classes.User
         sess = fixture_session()
         query = sess.query(User.name).prefix_with("PREFIX_1")
-        expected = "SELECT PREFIX_1 " "users.name AS users_name FROM users"
+        expected = "SELECT PREFIX_1 users.name AS users_name FROM users"
         self.assert_compile(query, expected, dialect=default.DefaultDialect())
 
     def test_one_suffix(self):
@@ -5194,7 +5194,7 @@ class PrefixSuffixWithTest(QueryTest, AssertsCompiledSQL):
         sess = fixture_session()
         query = sess.query(User.name).prefix_with("PREFIX_1", "PREFIX_2")
         expected = (
-            "SELECT PREFIX_1 PREFIX_2 " "users.name AS users_name FROM users"
+            "SELECT PREFIX_1 PREFIX_2 users.name AS users_name FROM users"
         )
         self.assert_compile(query, expected, dialect=default.DefaultDialect())
 
index c9907c765157e3de3a3ebb1836180c5775ac3679..93b3d8710ce97c47ccce9593ca26ef1be40f5ff8 100644 (file)
@@ -3429,7 +3429,7 @@ class M2OWDegradeTest(
             testing.db,
             q.all,
             CompiledSQL(
-                "SELECT a.id AS a_id, a.q AS a_q " "FROM a ORDER BY a.id", [{}]
+                "SELECT a.id AS a_id, a.q AS a_q FROM a ORDER BY a.id", [{}]
             ),
             # in the very unlikely case that the the FK col on parent is
             # deferred, we degrade to the JOIN version so that we don't need to
index 3b3175e10ec914157b2dbb6dfe2dc3222fc28313..7b29b4362a092ea86b0d76755c7bddf989d63851 100644 (file)
@@ -2299,7 +2299,7 @@ class ManyToOneTest(_fixtures.FixtureTest):
             testing.db,
             session.flush,
             CompiledSQL(
-                "INSERT INTO users (name) " "VALUES (:name)",
+                "INSERT INTO users (name) VALUES (:name)",
                 {"name": "imnewlyadded"},
             ),
             AllOf(
@@ -2616,7 +2616,7 @@ class ManyToManyTest(_fixtures.FixtureTest):
                 {"description": "item4updated", "items_id": objects[4].id},
             ),
             CompiledSQL(
-                "INSERT INTO keywords (name) " "VALUES (:name)",
+                "INSERT INTO keywords (name) VALUES (:name)",
                 {"name": "yellow"},
             ),
             CompiledSQL(
@@ -3416,7 +3416,7 @@ class InheritingRowSwitchTest(fixtures.MappedTest):
             # sync operation during _save_obj().update, this is safe to remove
             # again.
             CompiledSQL(
-                "UPDATE child SET pid=:pid " "WHERE child.cid = :child_cid",
+                "UPDATE child SET pid=:pid WHERE child.cid = :child_cid",
                 {"pid": 1, "child_cid": 1},
             ),
         )
index e01220d1150b26ce6bbb5266a99bed428b569d57..90ea0eaa039ec86680174e71fbaaf98fc1edc4ef 100644 (file)
@@ -3045,7 +3045,7 @@ class EagerDefaultsTest(fixtures.MappedTest):
             testing.db,
             s.flush,
             CompiledSQL(
-                "INSERT INTO test2 (id, foo, bar) " "VALUES (:id, :foo, :bar)",
+                "INSERT INTO test2 (id, foo, bar) VALUES (:id, :foo, :bar)",
                 [{"id": 1, "foo": None, "bar": 2}],
             ),
         )
index c069430fb1e2a8c6012e364dc630842aac2b147d..520944c9f0b6ef881e77c22c3cd3a3c732e88565 100644 (file)
@@ -149,14 +149,12 @@ def run_with_profile(runsnake=False, dump=False):
     print("Total cpu seconds: %.2f" % stats.total_tt)
     print(
         "Total execute calls: %d"
-        % counts_by_methname[
-            "<method 'execute' of 'sqlite3.Cursor' " "objects>"
-        ]
+        % counts_by_methname["<method 'execute' of 'sqlite3.Cursor' objects>"]
     )
     print(
         "Total executemany calls: %d"
         % counts_by_methname.get(
-            "<method 'executemany' of 'sqlite3.Cursor' " "objects>", 0
+            "<method 'executemany' of 'sqlite3.Cursor' objects>", 0
         )
     )
 
index 8b137fe4675a3b7f22d44bc149564fe8b73fe650..a692cd3fee3c3a43e42a30102472b36a02f0b580 100644 (file)
@@ -999,7 +999,7 @@ class DefaultRequirements(SuiteRequirements):
 
     @property
     def emulated_lastrowid(self):
-        """ "target dialect retrieves cursor.lastrowid or an equivalent
+        """target dialect retrieves cursor.lastrowid or an equivalent
         after an insert() construct executes.
         """
         return fails_on_everything_except(
@@ -1027,7 +1027,7 @@ class DefaultRequirements(SuiteRequirements):
 
     @property
     def emulated_lastrowid_even_with_sequences(self):
-        """ "target dialect retrieves cursor.lastrowid or an equivalent
+        """target dialect retrieves cursor.lastrowid or an equivalent
         after an insert() construct executes, even if the table has a
         Sequence on it.
         """
@@ -1040,7 +1040,7 @@ class DefaultRequirements(SuiteRequirements):
 
     @property
     def dbapi_lastrowid(self):
-        """ "target backend includes a 'lastrowid' accessor on the DBAPI
+        """target backend includes a 'lastrowid' accessor on the DBAPI
         cursor object.
 
         """
index 5756bb6927c01d702a6e6321efdf5a5542b8d14a..9d9f69bdb9b04a4cb6f55da69db45c9db16d0ec6 100644 (file)
@@ -1544,7 +1544,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             select(select(table1.c.name).label("foo")),
-            "SELECT (SELECT mytable.name FROM mytable) " "AS foo",
+            "SELECT (SELECT mytable.name FROM mytable) AS foo",
         )
 
         # scalar selects should not have any attributes on their 'c' or
@@ -2694,7 +2694,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
 
         self.assert_compile(
             s3,
-            "SELECT NULL AS anon_1, NULL AS anon__1 " "UNION "
+            "SELECT NULL AS anon_1, NULL AS anon__1 UNION "
             # without the feature tested in test_deduping_hash_algo we'd get
             # "SELECT true AS anon_2, true AS anon__1",
             "SELECT true AS anon_2, true AS anon__2",
@@ -3775,7 +3775,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
         )
         assert_raises_message(
             exc.CompileError,
-            "conflicts with unique bind parameter " "of the same name",
+            "conflicts with unique bind parameter of the same name",
             str,
             s,
         )
@@ -3789,7 +3789,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
         )
         assert_raises_message(
             exc.CompileError,
-            "conflicts with unique bind parameter " "of the same name",
+            "conflicts with unique bind parameter of the same name",
             str,
             s,
         )
@@ -4434,7 +4434,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
         )
         self.assert_compile(
             expr,
-            "(mytable.myid, mytable.name) IN " "(__[POSTCOMPILE_param_1])",
+            "(mytable.myid, mytable.name) IN (__[POSTCOMPILE_param_1])",
             checkparams={"param_1": [(1, "foo"), (5, "bar")]},
             check_post_param={"param_1": [(1, "foo"), (5, "bar")]},
             check_literal_execute={},
@@ -4469,7 +4469,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
         dialect.tuple_in_values = True
         self.assert_compile(
             tuple_(table1.c.myid, table1.c.name).in_([(1, "foo"), (5, "bar")]),
-            "(mytable.myid, mytable.name) IN " "(__[POSTCOMPILE_param_1])",
+            "(mytable.myid, mytable.name) IN (__[POSTCOMPILE_param_1])",
             dialect=dialect,
             checkparams={"param_1": [(1, "foo"), (5, "bar")]},
             check_post_param={"param_1": [(1, "foo"), (5, "bar")]},
@@ -4816,7 +4816,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
             select(table1.c.myid).where(
                 table1.c.myid == bindparam("foo", 5, literal_execute=True)
             ),
-            "SELECT mytable.myid FROM mytable " "WHERE mytable.myid = 5",
+            "SELECT mytable.myid FROM mytable WHERE mytable.myid = 5",
             literal_binds=True,
         )
 
@@ -4843,7 +4843,7 @@ class BindParameterTest(AssertsCompiledSQL, fixtures.TestBase):
             select(table1.c.myid).where(
                 table1.c.myid == bindparam("foo", 5, literal_execute=True)
             ),
-            "SELECT mytable.myid FROM mytable " "WHERE mytable.myid = 5",
+            "SELECT mytable.myid FROM mytable WHERE mytable.myid = 5",
             render_postcompile=True,
         )
 
@@ -6136,7 +6136,7 @@ class StringifySpecialTest(fixtures.TestBase):
 
         eq_ignore_whitespace(
             str(schema.AddConstraint(cons)),
-            "ALTER TABLE testtbl ADD EXCLUDE USING gist " "(room WITH =)",
+            "ALTER TABLE testtbl ADD EXCLUDE USING gist (room WITH =)",
         )
 
     def test_try_cast(self):
@@ -7337,7 +7337,7 @@ class CorrelateTest(fixtures.TestBase, AssertsCompiledSQL):
         s = select(t1.c.a)
         s2 = select(t1).where(t1.c.a == s.scalar_subquery())
         self.assert_compile(
-            s2, "SELECT t1.a FROM t1 WHERE t1.a = " "(SELECT t1.a FROM t1)"
+            s2, "SELECT t1.a FROM t1 WHERE t1.a = (SELECT t1.a FROM t1)"
         )
 
     def test_correlate_semiauto_where_singlefrom(self):
index 54fcba576ca41f2442f45ce083018358f5a0e0e3..93c385ba4d75d92415fb70b5cc9e7fe5dfdef19d 100644 (file)
@@ -286,7 +286,7 @@ class ConstraintGenTest(fixtures.TestBase, AssertsExecutionResults):
         if auto:
             fk_assertions.append(
                 CompiledSQL(
-                    "ALTER TABLE a ADD " "FOREIGN KEY(bid) REFERENCES b (id)"
+                    "ALTER TABLE a ADD FOREIGN KEY(bid) REFERENCES b (id)"
                 )
             )
         assertions.append(AllOf(*fk_assertions))
@@ -409,10 +409,10 @@ class ConstraintGenTest(fixtures.TestBase, AssertsExecutionResults):
             ),
             AllOf(
                 CompiledSQL(
-                    "ALTER TABLE b ADD " "FOREIGN KEY(aid) REFERENCES a (id)"
+                    "ALTER TABLE b ADD FOREIGN KEY(aid) REFERENCES a (id)"
                 ),
                 CompiledSQL(
-                    "ALTER TABLE a ADD " "FOREIGN KEY(bid) REFERENCES b (id)"
+                    "ALTER TABLE a ADD FOREIGN KEY(bid) REFERENCES b (id)"
                 ),
             ),
         ]
@@ -720,10 +720,10 @@ class ConstraintGenTest(fixtures.TestBase, AssertsExecutionResults):
             RegexSQL("^CREATE TABLE events"),
             AllOf(
                 CompiledSQL(
-                    "CREATE UNIQUE INDEX ix_events_name ON events " "(name)"
+                    "CREATE UNIQUE INDEX ix_events_name ON events (name)"
                 ),
                 CompiledSQL(
-                    "CREATE INDEX ix_events_location ON events " "(location)"
+                    "CREATE INDEX ix_events_location ON events (location)"
                 ),
                 CompiledSQL(
                     "CREATE UNIQUE INDEX sport_announcer ON events "
@@ -817,7 +817,7 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL):
 
                 self.assert_compile(
                     schema.CreateIndex(ix1),
-                    "CREATE INDEX %s " "ON %s (%s)" % (exp, tname, cname),
+                    "CREATE INDEX %s ON %s (%s)" % (exp, tname, cname),
                     dialect=dialect,
                 )
 
@@ -1237,7 +1237,7 @@ class ConstraintCompilationTest(fixtures.TestBase, AssertsCompiledSQL):
         # is disabled
         self.assert_compile(
             schema.CreateTable(t),
-            "CREATE TABLE tbl (" "a INTEGER, " "b INTEGER" ")",
+            "CREATE TABLE tbl (a INTEGER, b INTEGER)",
         )
 
     def test_render_drop_constraint(self):
index 0b665b84da69ef5b38e02a9190597abc9c2782f3..ef7eac51e3d2d3e4c7835682b68a5e3f8997679a 100644 (file)
@@ -518,7 +518,7 @@ class CTETest(fixtures.TestBase, AssertsCompiledSQL):
         else:
             assert_raises_message(
                 CompileError,
-                "Multiple, unrelated CTEs found " "with the same name: 'cte1'",
+                "Multiple, unrelated CTEs found with the same name: 'cte1'",
                 s.compile,
             )
 
index dbb5644cd1e7f9cb4cd1f966a76810210cdb2543..96b636bd058fc12be97d29f9557d71257bf142a6 100644 (file)
@@ -326,7 +326,7 @@ class SelectableTest(fixtures.TestBase, AssertsCompiledSQL):
         sel = select(basefrom.c.a)
 
         with testing.expect_deprecated(
-            r"The Selectable.replace_selectable\(\) " "method is deprecated"
+            r"The Selectable.replace_selectable\(\) method is deprecated"
         ):
             replaced = sel.replace_selectable(
                 basefrom, basefrom.join(joinfrom, basefrom.c.a == joinfrom.c.a)
index 0204d6e6fcbb72f586c90d770609623f84b71499..d044d8b57f064d78fa910da7c8a3bdc2e96d53e0 100644 (file)
@@ -2185,7 +2185,7 @@ class ClauseAdapterTest(fixtures.TestBase, AssertsCompiledSQL):
     def test_table_to_alias_9(self):
         s = select(literal_column("*")).select_from(t1).alias("foo")
         self.assert_compile(
-            s.select(), "SELECT foo.* FROM (SELECT * FROM table1) " "AS foo"
+            s.select(), "SELECT foo.* FROM (SELECT * FROM table1) AS foo"
         )
 
     def test_table_to_alias_10(self):
@@ -2194,13 +2194,13 @@ class ClauseAdapterTest(fixtures.TestBase, AssertsCompiledSQL):
         vis = sql_util.ClauseAdapter(t1alias)
         self.assert_compile(
             vis.traverse(s.select()),
-            "SELECT foo.* FROM (SELECT * FROM table1 " "AS t1alias) AS foo",
+            "SELECT foo.* FROM (SELECT * FROM table1 AS t1alias) AS foo",
         )
 
     def test_table_to_alias_11(self):
         s = select(literal_column("*")).select_from(t1).alias("foo")
         self.assert_compile(
-            s.select(), "SELECT foo.* FROM (SELECT * FROM table1) " "AS foo"
+            s.select(), "SELECT foo.* FROM (SELECT * FROM table1) AS foo"
         )
 
     def test_table_to_alias_12(self):
@@ -2209,7 +2209,7 @@ class ClauseAdapterTest(fixtures.TestBase, AssertsCompiledSQL):
         ff = vis.traverse(func.count(t1.c.col1).label("foo"))
         self.assert_compile(
             select(ff),
-            "SELECT count(t1alias.col1) AS foo FROM " "table1 AS t1alias",
+            "SELECT count(t1alias.col1) AS foo FROM table1 AS t1alias",
         )
         assert list(_from_objects(ff)) == [t1alias]
 
@@ -2700,7 +2700,7 @@ class SpliceJoinsTest(fixtures.TestBase, AssertsCompiledSQL):
         )
         self.assert_compile(
             sql_util.splice_joins(table1, j2),
-            "table1 JOIN table4 AS table4_1 ON " "table1.col3 = table4_1.col3",
+            "table1 JOIN table4 AS table4_1 ON table1.col3 = table4_1.col3",
         )
         self.assert_compile(
             sql_util.splice_joins(sql_util.splice_joins(table1, j1), j2),
@@ -2726,23 +2726,23 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
     def test_columns(self):
         s = t1.select()
         self.assert_compile(
-            s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
+            s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1"
         )
         select_copy = s.add_columns(column("yyy"))
         self.assert_compile(
             select_copy,
-            "SELECT table1.col1, table1.col2, " "table1.col3, yyy FROM table1",
+            "SELECT table1.col1, table1.col2, table1.col3, yyy FROM table1",
         )
         is_not(s.selected_columns, select_copy.selected_columns)
         is_not(s._raw_columns, select_copy._raw_columns)
         self.assert_compile(
-            s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
+            s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1"
         )
 
     def test_froms(self):
         s = t1.select()
         self.assert_compile(
-            s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
+            s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1"
         )
         select_copy = s.select_from(t2)
         self.assert_compile(
@@ -2752,13 +2752,13 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
         )
 
         self.assert_compile(
-            s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
+            s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1"
         )
 
     def test_prefixes(self):
         s = t1.select()
         self.assert_compile(
-            s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
+            s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1"
         )
         select_copy = s.prefix_with("FOOBER")
         self.assert_compile(
@@ -2767,7 +2767,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
             "table1.col3 FROM table1",
         )
         self.assert_compile(
-            s, "SELECT table1.col1, table1.col2, " "table1.col3 FROM table1"
+            s, "SELECT table1.col1, table1.col2, table1.col3 FROM table1"
         )
 
     def test_execution_options(self):
index ddfb9aea2009ccb8006d2b9154c97f3de4ee1b67..a5cfad5b6945a1db69ccc9dae3b2bc3430b932e4 100644 (file)
@@ -1120,7 +1120,7 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
             Column("q", Integer),
         )
         with expect_warnings(
-            "Column 't.x' is marked as a member.*" "may not store NULL.$"
+            "Column 't.x' is marked as a member.*may not store NULL.$"
         ):
             self.assert_compile(
                 t.insert(), "INSERT INTO t (q) VALUES (:q)", params={"q": 5}
@@ -1136,7 +1136,7 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
         d = postgresql.dialect()
         d.implicit_returning = True
         with expect_warnings(
-            "Column 't.x' is marked as a member.*" "may not store NULL.$"
+            "Column 't.x' is marked as a member.*may not store NULL.$"
         ):
             self.assert_compile(
                 t.insert(),
@@ -1156,7 +1156,7 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
         d.implicit_returning = False
 
         with expect_warnings(
-            "Column 't.x' is marked as a member.*" "may not store NULL.$"
+            "Column 't.x' is marked as a member.*may not store NULL.$"
         ):
             self.assert_compile(
                 t.insert(),
@@ -1172,7 +1172,7 @@ class InsertTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
             Column("notpk", String(10), nullable=True),
         )
         with expect_warnings(
-            "Column 't.id' is marked as a member.*" "may not store NULL.$"
+            "Column 't.id' is marked as a member.*may not store NULL.$"
         ):
             self.assert_compile(
                 t.insert(),
@@ -1755,7 +1755,7 @@ class MultirowTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
 
         self.assert_compile(
             stmt,
-            "INSERT INTO sometable (id, data) VALUES " "(foobar(), ?)",
+            "INSERT INTO sometable (id, data) VALUES (foobar(), ?)",
             checkparams={"data": "foo"},
             params={"data": "foo"},
             dialect=dialect,
index 627310d8f1724fd419d715c84045de7db62692d5..17991ea2e35158599274a15abb5f45a92587e1dc 100644 (file)
@@ -221,7 +221,7 @@ class LambdaElementTest(
 
         self.assert_compile(
             go("u1"),
-            "SELECT users.id FROM users " "WHERE users.name = 'u1'",
+            "SELECT users.id FROM users WHERE users.name = 'u1'",
             literal_binds=True,
         )
 
index 3592bc6f00613b6e136135425837658c7118a3d6..8b43b0f98acddb4c7fa67616c060643d8f4dc42a 100644 (file)
@@ -2882,7 +2882,7 @@ class UseExistingTest(testing.AssertsCompiledSQL, fixtures.TablesTest):
 
         assert_raises_message(
             exc.InvalidRequestError,
-            "Table 'users' is already defined for this " "MetaData instance.",
+            "Table 'users' is already defined for this MetaData instance.",
             go,
         )
 
@@ -5665,7 +5665,7 @@ class NamingConventionTest(fixtures.TestBase, AssertsCompiledSQL):
         dialect.max_identifier_length = 15
         self.assert_compile(
             schema.CreateIndex(ix),
-            "CREATE INDEX ix_user_2de9 ON " '"user" (data, "Data2", "Data3")',
+            'CREATE INDEX ix_user_2de9 ON "user" (data, "Data2", "Data3")',
             dialect=dialect,
         )
 
@@ -5949,7 +5949,7 @@ class NamingConventionTest(fixtures.TestBase, AssertsCompiledSQL):
         # no issue with native boolean
         self.assert_compile(
             schema.CreateTable(u1),
-            'CREATE TABLE "user" (' "x BOOLEAN" ")",
+            """CREATE TABLE "user" (x BOOLEAN)""",
             dialect="postgresql",
         )
 
index c0b5cb47d660a8ae5be1bff5790926d234b9fa08..9c87b3557763cc415f3a0b5b1c8c37400018a6eb 100644 (file)
@@ -419,7 +419,7 @@ class MultiElementExprTest(fixtures.TestBase, testing.AssertsCompiledSQL):
         ),
         (
             lambda p, q: (1 - p) * (2 - q) * (3 - p) * (4 - q),
-            "(:p_1 - t.p) * (:q_1 - t.q) * " "(:p_2 - t.p) * (:q_2 - t.q)",
+            "(:p_1 - t.p) * (:q_1 - t.q) * (:p_2 - t.p) * (:q_2 - t.q)",
         ),
         (
             lambda p, q: (
@@ -3227,7 +3227,7 @@ class RegexpTestStrCompiler(fixtures.TestBase, testing.AssertsCompiledSQL):
                 self.table.c.myid.match("foo"),
                 self.table.c.myid.regexp_match("xx"),
             ),
-            "mytable.myid MATCH :myid_1 AND " "mytable.myid <regexp> :myid_2",
+            "mytable.myid MATCH :myid_1 AND mytable.myid <regexp> :myid_2",
         )
         self.assert_compile(
             and_(
index 51382b19b4a72a74d8e85a765551e31ea1b63959..f3bc8e494813f9a3a5400833513b966f0a177804 100644 (file)
@@ -821,7 +821,7 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
         # what if table/schema *are* quoted?
         self.assert_compile(
             t1.select().set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL),
-            "SELECT " "Foo.T1.Col1 AS Foo_T1_Col1 " "FROM " "Foo.T1",
+            "SELECT Foo.T1.Col1 AS Foo_T1_Col1 FROM Foo.T1",
         )
 
     def test_quote_flag_propagate_check_constraint(self):
@@ -830,7 +830,7 @@ class QuoteTest(fixtures.TestBase, AssertsCompiledSQL):
         CheckConstraint(t.c.x > 5)
         self.assert_compile(
             schema.CreateTable(t),
-            "CREATE TABLE t (" '"x" INTEGER, ' 'CHECK ("x" > 5)' ")",
+            'CREATE TABLE t ("x" INTEGER, CHECK ("x" > 5))',
         )
 
     def test_quote_flag_propagate_index(self):
index be1f57121b5e7f21b0d29ada04e9e158a2942bb0..8651207a912d140ba1d849b0d88e14928e44b44f 100644 (file)
@@ -490,7 +490,7 @@ class CursorResultTest(fixtures.TablesTest):
         if use_pickle:
             with expect_raises_message(
                 exc.NoSuchColumnError,
-                "Row was unpickled; lookup by ColumnElement is " "unsupported",
+                "Row was unpickled; lookup by ColumnElement is unsupported",
             ):
                 result[0]._mapping[users.c.user_id]
         else:
@@ -499,7 +499,7 @@ class CursorResultTest(fixtures.TablesTest):
         if use_pickle:
             with expect_raises_message(
                 exc.NoSuchColumnError,
-                "Row was unpickled; lookup by ColumnElement is " "unsupported",
+                "Row was unpickled; lookup by ColumnElement is unsupported",
             ):
                 result[0]._mapping[users.c.user_name]
         else:
index 301ad9ffdf8c026c163506ed346feee42e729666..941a02d9e7e99d50ea44977ebe3bdef295bb0a90 100644 (file)
@@ -470,7 +470,7 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL):
                 r"SELECT * FROM pg_attribute WHERE "
                 r"attrelid = :tab\:\:regclass"
             ),
-            "SELECT * FROM pg_attribute WHERE " "attrelid = %(tab)s::regclass",
+            "SELECT * FROM pg_attribute WHERE attrelid = %(tab)s::regclass",
             params={"tab": None},
             dialect="postgresql",
         )
@@ -483,7 +483,7 @@ class BindParamTest(fixtures.TestBase, AssertsCompiledSQL):
                 r"SELECT * FROM pg_attribute WHERE "
                 r"attrelid = foo::regclass"
             ),
-            "SELECT * FROM pg_attribute WHERE " "attrelid = foo::regclass",
+            "SELECT * FROM pg_attribute WHERE attrelid = foo::regclass",
             params={},
             dialect="postgresql",
         )
index 76249f561745046b83aed908479dc9997204d578..898d6fa0a8c500ddbc40202c7312b4085f5b2983 100644 (file)
@@ -2303,7 +2303,7 @@ class EnumTest(AssertsCompiledSQL, fixtures.TablesTest):
             assert_raises(
                 (exc.DBAPIError,),
                 connection.exec_driver_sql,
-                "insert into my_table " "(data) values('four')",
+                "insert into my_table (data) values('four')",
             )
             trans.rollback()