]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
flake8 fix
authorNathan Louie <nxlouie@umich.edu>
Tue, 13 Dec 2022 07:15:36 +0000 (23:15 -0800)
committerNathan Louie <nxlouie@umich.edu>
Tue, 13 Dec 2022 07:15:36 +0000 (23:15 -0800)
alembic/command.py
alembic/util/exc.py
tests/test_command.py

index 76db9b00af63bd7166f3c388cea624167e060a29..c132e46c852449f78ccd12206e125842cab49549 100644 (file)
@@ -19,6 +19,7 @@ if TYPE_CHECKING:
 
 log = logging.getLogger(__name__)
 
+
 def list_templates(config):
     """List available templates.
 
@@ -245,7 +246,8 @@ def revision(
 def check(
     config: "Config",
 ) -> None:
-    """Checks if the revision command with autogenerate has pending upgrade ops to run.
+    """Checks if the revision command with autogenerate has pending upgrade
+    ops to run.
 
     :param config: a :class:`.Config` object.
 
@@ -289,9 +291,11 @@ def check(
     migration_script = revision_context.generated_revisions[-1]
     diffs = migration_script.upgrade_ops.as_diffs()
     if diffs:
-        raise util.RevisionOpsNotEmptyError(f"Revision has upgrade ops to run: {diffs}.")
+        raise util.RevisionOpsNotEmptyError(
+            f"Revision has upgrade ops to run: {diffs}."
+        )
     else:
-        log.info("Revision has no upgrade ops to run.")   
+        log.info("Revision has no upgrade ops to run.")
 
 
 def merge(
index 15d118b0257a43fec5feea49b5e03c258940c242..533e1a2b05a4dba84e36232601a47be49d4b1a47 100644 (file)
@@ -1,5 +1,6 @@
 class CommandError(Exception):
     pass
 
+
 class RevisionOpsNotEmptyError(Exception):
     pass
index 1a7c13c54e60042f0f26cb4ff766aae162757a32..99a3be82b6156ffe89c5814953c03344910dd328 100644 (file)
@@ -8,7 +8,7 @@ import re
 from typing import cast
 
 from sqlalchemy import exc as sqla_exc
-from sqlalchemy import VARCHAR, text
+from sqlalchemy import text, VARCHAR
 from sqlalchemy.engine import Engine
 from sqlalchemy.sql.schema import Column
 
@@ -579,13 +579,14 @@ finally:
 
     def test_check_no_changes(self):
         self._env_fixture()
-        command.check(self.cfg) # no problem
+        command.check(self.cfg)  # no problem
 
     def test_check_changes_detected(self):
         self._env_fixture()
         with mock.patch(
             "alembic.operations.ops.UpgradeOps.as_diffs",
-            return_value=[('remove_column', None, 'foo', Column('old_data', VARCHAR()))]
+            return_value=[('remove_column', None, 'foo',
+                           Column('old_data', VARCHAR()))]
         ):
             assert_raises_message(
                 util.RevisionOpsNotEmptyError,