Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance version_path_separator behaviour by adding a newline option #1510

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix formatting
References: #1509
  • Loading branch information
pristupa committed Jul 27, 2024
commit b1465ec5d8fd421b52f1e761f6a4c3648c4a2475
7 changes: 5 additions & 2 deletions alembic/script/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
12 changes: 9 additions & 3 deletions alembic/testing/assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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):
Expand Down
Loading