From b1465ec5d8fd421b52f1e761f6a4c3648c4a2475 Mon Sep 17 00:00:00 2001 From: "Pavel V. Pristupa" Date: Sat, 27 Jul 2024 23:42:35 +0200 Subject: [PATCH] Fix formatting References: #1509 --- alembic/script/base.py | 7 +++++-- alembic/testing/assertions.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/alembic/script/base.py b/alembic/script/base.py index d3cccf6c..30df6ddb 100644 --- a/alembic/script/base.py +++ b/alembic/script/base.py @@ -201,7 +201,8 @@ def from_config(cls, config: Config) -> ScriptDirectory: raise ValueError( "'%s' is not a valid value for " "version_path_separator; " - "expected 'space', 'newline', 'os', ':', ';'" % version_path_separator + "expected 'space', 'newline', 'os', ':', ';'" + % version_path_separator ) from ke else: if split_char is None: @@ -211,7 +212,9 @@ def from_config(cls, config: Config) -> ScriptDirectory: ) else: version_locations = [ - x.strip() for x in version_locations_str.split(split_char) if x + x.strip() + for x in version_locations_str.split(split_char) + if x ] else: version_locations = None diff --git a/alembic/testing/assertions.py b/alembic/testing/assertions.py index d1f7103f..e071697c 100644 --- a/alembic/testing/assertions.py +++ b/alembic/testing/assertions.py @@ -74,7 +74,9 @@ class _ErrorContainer: @contextlib.contextmanager -def _expect_raises(except_cls, msg=None, check_context=False, text_exact=False): +def _expect_raises( + except_cls, msg=None, check_context=False, text_exact=False +): ec = _ErrorContainer() if check_context: are_we_already_in_a_traceback = sys.exc_info()[0] @@ -101,8 +103,12 @@ def expect_raises(except_cls, check_context=True): return _expect_raises(except_cls, check_context=check_context) -def expect_raises_message(except_cls, msg, check_context=True, text_exact=False): - return _expect_raises(except_cls, msg=msg, check_context=check_context, text_exact=text_exact) +def expect_raises_message( + except_cls, msg, check_context=True, text_exact=False +): + return _expect_raises( + except_cls, msg=msg, check_context=check_context, text_exact=text_exact + ) def eq_ignore_whitespace(a, b, msg=None):