]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Source cleanups
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 1 Jan 2020 16:17:28 +0000 (11:17 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 1 Jan 2020 16:17:28 +0000 (11:17 -0500)
- install flake8 to pre-commit hooks
- remove unused run_tests.py file
- ensure full pre-commit run succeeds

Change-Id: I31290078e48821ce9d78d45a74b51d0004047a1e

.pre-commit-config.yaml
alembic/__init__.py
run_tests.py [deleted file]
tests/test_oracle.py

index f9b217e552002c06a1cf7cee3645e10a95e12e0b..e4427aa3a3d11fe5b28cb12a238c226267e9cab7 100644 (file)
@@ -12,4 +12,18 @@ repos:
     hooks:
     -   id: zimports
 
+-   repo: https://github.com/pycqa/flake8
+    rev: master
+    hooks:
+    -   id: flake8
+        additional_dependencies:
+          - flake8-import-order
+          - flake8-builtins
+          - flake8-docstrings
+          - flake8-rst-docstrings
+          - pydocstyle<4.0.0
+          - pygments
+
+
+
 
index fdb715eb712b16c26278218c3437aad402c175bb..d30c1e9b8fc540f55a2d0990cb70b3e15be39afe 100644 (file)
@@ -6,7 +6,7 @@ from . import op  # noqa
 from .runtime import environment
 from .runtime import migration
 
-__version__ = '1.3.3'
+__version__ = "1.3.3"
 
 package_dir = path.abspath(path.dirname(__file__))
 
diff --git a/run_tests.py b/run_tests.py
deleted file mode 100755 (executable)
index d4f27d5..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-####### NOTE:
-####### This file is deprecated as is nose support.
-####### Please use py.test or the tox test runner to run tests.
-####### See README.unittests.rst
-
-
-import os
-# use bootstrapping so that test plugins are loaded
-# without touching the main library before coverage starts
-bootstrap_file = os.path.join(
-    os.path.dirname(__file__), "alembic",
-    "testing", "plugin", "bootstrap.py"
-)
-
-with open(bootstrap_file) as f:
-    code = compile(f.read(), "bootstrap.py", 'exec')
-    to_bootstrap = "nose"
-    exec(code, globals(), locals())
-
-
-from noseplugin import NoseSQLAlchemy
-import nose
-nose.main(addplugins=[NoseSQLAlchemy()])
index 2001dd9d73c295af6cb8ea192ebb76602dc080f0..9556a2e66532d52393c5c3de439262fde00dca2c 100644 (file)
@@ -104,28 +104,16 @@ class OpTest(TestBase):
     def test_create_table_comment(self):
         # this is handled by SQLAlchemy's compilers
         context = op_fixture("oracle")
-        op.create_table_comment(
-            't2',
-            comment='t2 table',
-            schema='foo'
-        )
-        context.assert_(
-            "COMMENT ON TABLE foo.t2 IS 't2 table'"
-        )
+        op.create_table_comment("t2", comment="t2 table", schema="foo")
+        context.assert_("COMMENT ON TABLE foo.t2 IS 't2 table'")
 
     @config.requirements.comments_api
     @config.requirements.sqlalchemy_issue_4436
     def test_drop_table_comment(self):
         # this is handled by SQLAlchemy's compilers
         context = op_fixture("oracle")
-        op.drop_table_comment(
-            't2',
-            existing_comment='t2 table',
-            schema='foo'
-        )
-        context.assert_(
-            "COMMENT ON TABLE foo.t2 IS ''"
-        )
+        op.drop_table_comment("t2", existing_comment="t2 table", schema="foo")
+        context.assert_("COMMENT ON TABLE foo.t2 IS ''")
 
     def test_drop_index(self):
         context = op_fixture("oracle")