From: Mike Bayer Date: Wed, 1 Jan 2020 16:17:28 +0000 (-0500) Subject: Source cleanups X-Git-Tag: rel_1_3_3~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d131dc42daf6aa9a14cfab210bbd84f1ec745ee2;p=thirdparty%2Fsqlalchemy%2Falembic.git Source cleanups - install flake8 to pre-commit hooks - remove unused run_tests.py file - ensure full pre-commit run succeeds Change-Id: I31290078e48821ce9d78d45a74b51d0004047a1e --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f9b217e5..e4427aa3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 + + + diff --git a/alembic/__init__.py b/alembic/__init__.py index fdb715eb..d30c1e9b 100644 --- a/alembic/__init__.py +++ b/alembic/__init__.py @@ -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 index d4f27d51..00000000 --- a/run_tests.py +++ /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()]) diff --git a/tests/test_oracle.py b/tests/test_oracle.py index 2001dd9d..9556a2e6 100644 --- a/tests/test_oracle.py +++ b/tests/test_oracle.py @@ -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")