From 5701b7f09f723b727bbee95d19d107d6cc1d7717 Mon Sep 17 00:00:00 2001 From: Eric Borczuk Date: Fri, 28 Feb 2020 10:31:00 -0500 Subject: [PATCH] Blackened --- lib/sqlalchemy/dialects/postgresql/base.py | 8 +++++--- test/dialect/postgresql/test_reflection.py | 15 +++------------ 2 files changed, 8 insertions(+), 15 deletions(-) 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",}, ], ) -- 2.47.2