From: Eric Borczuk Date: Fri, 28 Feb 2020 15:31:00 +0000 (-0500) Subject: Blackened X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5701b7f09f723b727bbee95d19d107d6cc1d7717;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Blackened --- diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index f4499c5130..156f77ae31 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -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): diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 8438ede0bd..fae989beeb 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -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",}, ], )