]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Blackened 5172/head
authorEric Borczuk <eric@trialspark.com>
Fri, 28 Feb 2020 15:31:00 +0000 (10:31 -0500)
committerEric Borczuk <eric@trialspark.com>
Fri, 28 Feb 2020 15:31:00 +0000 (10:31 -0500)
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_reflection.py

index f4499c5130c6e62c45f8a53a720c6fb3cc4cf4db..156f77ae31b11727dfe6dd479dd526e20e626be4 100644 (file)
@@ -3491,13 +3491,15 @@ class PGDialect(default.DefaultDialect):
             # "CHECK (((a\n < 1)\n OR\n (a\n >= 5))\n)"
 
             m = re.match(
-                r"^CHECK *\((.+)\)( NOT VALID)?$", src, flags=re.DOTALL)
+                r"^CHECK *\((.+)\)( NOT VALID)?$", src, flags=re.DOTALL
+            )
             if not m:
                 util.warn("Could not parse CHECK constraint text: %r" % src)
                 sqltext = ""
             else:
-                match_without_newlines = ' '.join(
-                    m.group(1).splitlines()).strip()
+                match_without_newlines = " ".join(
+                    m.group(1).splitlines()
+                ).strip()
                 sqltext = re.sub(r"^\((.+)\)$", r"\1", match_without_newlines)
             entry = {"name": name, "sqltext": sqltext}
             if m and m.group(2):
index 8438ede0bdb7ffb7be21f5fb7023d32c609e9fb6..fae989beeb08ecf7901d3f62ab181d0102fb7f74 100644 (file)
@@ -1602,18 +1602,9 @@ class ReflectionTest(fixtures.TestBase):
             eq_(
                 check_constraints,
                 [
-                    {
-                        "name": "some name",
-                        "sqltext": "a  IS  NOT   NULL ",
-                    },
-                    {
-                        "name": "some other name",
-                        "sqltext": "b IS NOT NULL",
-                    },
-                    {
-                        "name": "some CRLF name",
-                        "sqltext": "c  IS NOT NULL",
-                    }
+                    {"name": "some name", "sqltext": "a  IS  NOT   NULL ",},
+                    {"name": "some other name", "sqltext": "b IS NOT NULL",},
+                    {"name": "some CRLF name", "sqltext": "c  IS NOT NULL",},
                 ],
             )