]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
run a black run
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Mar 2019 01:29:05 +0000 (20:29 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Mar 2019 01:29:05 +0000 (20:29 -0500)
fix some pep8s that snuck in

Change-Id: Ied282007df30a52d232b1ba88659f2a123ff380f

lib/sqlalchemy/__init__.py
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/util/langhelpers.py
test/engine/test_parseconnect.py
test/engine/test_pool.py
test/orm/test_events.py
test/orm/test_query.py
test/orm/test_unitofwork.py
test/sql/test_insert.py

index 788ba0b68ce18420eef7e96faab3bf3d05dbc294..1df12a8c899a734a9f6a8c1d5599de634d26658f 100644 (file)
@@ -122,7 +122,7 @@ from .engine import create_engine  # noqa nosort
 from .engine import engine_from_config  # noqa nosort
 
 
-__version__ = '1.3.1'
+__version__ = "1.3.1"
 
 
 def __go(lcls):
index 1b89a3ac6ecdf89e384546f8ee038e8589bbc738..5725b1f05b22e8067fa125d342be2578b59bcd92 100644 (file)
@@ -2545,8 +2545,10 @@ class MySQLDialect(default.DefaultDialect):
         # but use case-insensitive matching for these two modes in any case.
 
         if self._casing in (1, 2):
+
             def lower(s):
                 return s.lower()
+
         else:
             # if on case sensitive, there can be two tables referenced
             # with the same name different casing, so we need to use
index db8d8bcbee4fde359e037d6b04f1f2e787779fce..9544b7d117f0aaac18374ed997e97fda4849a63f 100644 (file)
@@ -1041,7 +1041,8 @@ class Query(object):
                 raise sa_exc.InvalidRequestError(
                     "Incorrect names of values in identifier to formulate "
                     "primary key for query.get(); primary key attribute names"
-                    " are %s" % ",".join(
+                    " are %s"
+                    % ",".join(
                         "'%s'" % prop.key
                         for prop in mapper._identity_key_props
                     )
index ec3c9790f2250906ec6df699c6d6761057623dbf..d05adecdbb24a82ef2ef9128923da6d182576167 100644 (file)
@@ -595,6 +595,7 @@ class LazyLoader(AbstractRelationshipLoader, util.MemoizedSlots):
 
         def visit_bindparam(bindparam):
             bindparam.unique = False
+
         visitors.traverse(criterion, {}, {"bindparam": visit_bindparam})
 
         def visit_bindparam(bindparam):
index efc950f1da2982b6d088e4f2927afa4bcfd1cdef..117a9e229265426273e45ee38d6c69728164e01b 100644 (file)
@@ -1653,7 +1653,9 @@ def inject_param_text(doctext, inject_params):
             # TODO: this still wont cover if the code example itself has blank
             # lines in it, need to detect those via indentation.
             lines.append(line)
-            lines.append(doclines.pop(0))  # the blank line following a code example
+            lines.append(
+                doclines.pop(0)
+            )  # the blank line following a code example
             continue
         lines.append(line)
 
index b7e8905176c82d71949570140b4530c8248d4e01..1277425c150f44985ba5d1bfaed37500bc3fc7b4 100644 (file)
@@ -148,11 +148,20 @@ class URLTest(fixtures.TestBase):
         )
 
     def test_comparison(self):
-        components = ('drivername', 'username', 'password', 'host',
-                      'database', 'query', 'port')
+        components = (
+            "drivername",
+            "username",
+            "password",
+            "host",
+            "database",
+            "query",
+            "port",
+        )
 
-        common_url = "dbtype://username:password" \
-                     "@[2001:da8:2004:1000:202:116:160:90]:80/database?foo=bar"
+        common_url = (
+            "dbtype://username:password"
+            "@[2001:da8:2004:1000:202:116:160:90]:80/database?foo=bar"
+        )
         other_url = "dbtype://uname:pwd@host/"
 
         url1 = url.make_url(common_url)
@@ -165,7 +174,7 @@ class URLTest(fixtures.TestBase):
         is_false(url1 == url3)
 
         for curr_component in components:
-            setattr(url2, curr_component, 'new_changed_value')
+            setattr(url2, curr_component, "new_changed_value")
             is_true(url1 != url2)
             is_false(url1 == url2)
             setattr(url2, curr_component, getattr(url1, curr_component))
index 45e13626030a03124612b0c0e25e3aa28626a95c..1aadd477d98878a1434956139e0084d50552f4cc 100644 (file)
@@ -776,8 +776,7 @@ class QueuePoolTest(PoolTestBase):
 
     def test_timeout_accessor(self):
         expected_timeout = 123
-        p = self._queuepool_fixture(
-            timeout=expected_timeout)
+        p = self._queuepool_fixture(timeout=expected_timeout)
         eq_(p.timeout(), expected_timeout)
 
     @testing.requires.timing_intensive
index d6d087d753416a1dbcf1b09535cba1c78d0d20bf..d913f3c7740563e97f8c2826206f5c17b5c59f4f 100644 (file)
@@ -2004,7 +2004,7 @@ class SessionLifecycleEventsTest(_RemoveListeners, _fixtures.FixtureTest):
             [call.pending_to_persistent(sess, u1), call.flag_checked(u1)],
         )
 
-        u1.name = 'u2'
+        u1.name = "u2"
         sess.flush()
 
         # event was not called again
index 935e3e31c43ad77e0b7094c5ba61a9bb7074aa10..8f962d581180d04f429be3b72322c848a9140ecb 100644 (file)
@@ -668,9 +668,7 @@ class GetTest(QueryTest):
         s = Session()
         q = s.query(CompositePk)
         assert_raises(
-            sa_exc.InvalidRequestError,
-            q.get,
-            {"i": 1, "j": '2', "k": 3}
+            sa_exc.InvalidRequestError, q.get, {"i": 1, "j": "2", "k": 3}
         )
 
     def test_get(self):
index d6ca166004c927feb112f85638ebf037aaaa9c77..60452ea7fc0c05584a1837044bce88382870a87b 100644 (file)
@@ -506,11 +506,7 @@ class ClauseAttributesTest(fixtures.MappedTest):
             "pk_t",
             metadata,
             Column(
-                "p_id",
-                Integer,
-                key="id",
-                autoincrement=True,
-                primary_key=True,
+                "p_id", Integer, key="id", autoincrement=True, primary_key=True
             ),
             Column("data", String(30)),
         )
index cf6715a0e6a60ab524a1af50720ff9370b339a39..f4516f94293428dd98dfdbba0923ed2b2c739113 100644 (file)
@@ -1260,12 +1260,7 @@ class MultirowTest(_InsertTestBase, fixtures.TablesTest, AssertsCompiledSQL):
         table = Table(
             "sometable",
             metadata,
-            Column(
-                "id",
-                Integer,
-                autoincrement=False,
-                primary_key=True,
-            ),
+            Column("id", Integer, autoincrement=False, primary_key=True),
             Column("data", String),
         )