From b2d629f18695ecb08cddeb99d7c2573e1f3d04b2 Mon Sep 17 00:00:00 2001 From: Jeff Horemans Date: Tue, 13 Aug 2024 17:16:38 +0200 Subject: [PATCH] Reformatted changed files with black. --- lib/sqlalchemy/dialects/sqlite/base.py | 5 ++-- test/dialect/test_sqlite.py | 41 +++++++++++++++----------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index 1db4f49d15..a678e10940 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -2684,8 +2684,9 @@ class SQLiteDialect(default.DefaultDialect): ) """ cks = [] - for match in re.finditer(CHECK_PATTERN, table_data or "", - re.I | re.S | re.VERBOSE): + for match in re.finditer( + CHECK_PATTERN, table_data or "", re.I | re.S | re.VERBOSE + ): name = match.group(1) if name: diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index ccfbb31a06..0a5acdec94 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -1817,22 +1817,25 @@ class ConstraintReflectionTest(fixtures.TestBase): Table("q", meta, Column("id", Integer), PrimaryKeyConstraint("id")) # intentional new line - Table("r", meta, - Column("id", Integer), - Column("value", Integer), - Column("prefix", String), - PrimaryKeyConstraint("id"), - CheckConstraint("id > 0"), - # Constraint definition with newline and tab characters - CheckConstraint( - """((value > 0) AND \n\t(value < 100) AND \n\t + Table( + "r", + meta, + Column("id", Integer), + Column("value", Integer), + Column("prefix", String), + PrimaryKeyConstraint("id"), + CheckConstraint("id > 0"), + # Constraint definition with newline and tab characters + CheckConstraint( + """((value > 0) AND \n\t(value < 100) AND \n\t (value != 50))""", - name='ck_r_value_multiline'), - # Constraint name with special chars and 'check' in the name - CheckConstraint("value IS NOT NULL", name="^check-r* #\n\t"), - # Constraint definition with special characters. - CheckConstraint("prefix NOT GLOB '*[^-. /#,]*'") - ) + name="ck_r_value_multiline", + ), + # Constraint name with special chars and 'check' in the name + CheckConstraint("value IS NOT NULL", name="^check-r* #\n\t"), + # Constraint definition with special characters. + CheckConstraint("prefix NOT GLOB '*[^-. /#,]*'"), + ) meta.create_all(conn) @@ -2482,9 +2485,11 @@ class ConstraintReflectionTest(fixtures.TestBase): {"sqltext": "value IS NOT NULL", "name": "^check-r* #\n\t"}, # Triple-quote multi-line definition should have added a # newline and whitespace: - {"sqltext": "((value > 0) AND \n\t(value < 100) AND \n\t\n" - " (value != 50))", - "name": "ck_r_value_multiline"}, + { + "sqltext": "((value > 0) AND \n\t(value < 100) AND \n\t\n" + " (value != 50))", + "name": "ck_r_value_multiline", + }, {"sqltext": "id > 0", "name": None}, {"sqltext": "prefix NOT GLOB '*[^-. /#,]*'", "name": None}, ], -- 2.47.3