summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-05-31 17:12:41 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-05-31 17:12:41 -0400
commitb526a115e774fecc6e5df0edcbb239b80a367e2a (patch)
treefed19921a56c3931ae5575dd508e3b92c7c3ac80
parentd9dbfc4060e7c479bfdba37de16f6062502acee3 (diff)
downloadalembic-b526a115e774fecc6e5df0edcbb239b80a367e2a.tar.gz
- Fixed unit tests to run correctly under the SQLAlchemy 1.0.x series
prior to version 1.0.10 where a particular bug involving Postgresql exclude constraints was fixed. Change-Id: Ief64b19b75e4c2c3661ac95d5b03d0c8e0fe5619 Fixes: #431
-rw-r--r--alembic/testing/requirements.py7
-rw-r--r--alembic/util/__init__.py2
-rw-r--r--alembic/util/sqla_compat.py1
-rw-r--r--docs/build/changelog.rst8
-rw-r--r--tests/test_postgresql.py2
5 files changed, 18 insertions, 2 deletions
diff --git a/alembic/testing/requirements.py b/alembic/testing/requirements.py
index 0d90643..4468ef2 100644
--- a/alembic/testing/requirements.py
+++ b/alembic/testing/requirements.py
@@ -104,6 +104,13 @@ class SuiteRequirements(Requirements):
)
@property
+ def fail_before_sqla_1010(self):
+ return exclusions.fails_if(
+ lambda config: not util.sqla_1010,
+ "SQLAlchemy 1.0.10 or greater required"
+ )
+
+ @property
def fail_before_sqla_099(self):
return exclusions.fails_if(
lambda config: not util.sqla_099,
diff --git a/alembic/util/__init__.py b/alembic/util/__init__.py
index 2241111..bb249dc 100644
--- a/alembic/util/__init__.py
+++ b/alembic/util/__init__.py
@@ -8,7 +8,7 @@ from .pyfiles import ( # noqa
pyc_file_from_path, load_python_file, edit)
from .sqla_compat import ( # noqa
sqla_07, sqla_079, sqla_08, sqla_083, sqla_084, sqla_09, sqla_092,
- sqla_094, sqla_099, sqla_100, sqla_105, sqla_110)
+ sqla_094, sqla_099, sqla_100, sqla_105, sqla_110, sqla_1010)
from .exc import CommandError
diff --git a/alembic/util/sqla_compat.py b/alembic/util/sqla_compat.py
index 28a6548..57eacd5 100644
--- a/alembic/util/sqla_compat.py
+++ b/alembic/util/sqla_compat.py
@@ -28,6 +28,7 @@ sqla_094 = _vers >= (0, 9, 4)
sqla_099 = _vers >= (0, 9, 9)
sqla_100 = _vers >= (1, 0, 0)
sqla_105 = _vers >= (1, 0, 5)
+sqla_1010 = _vers >= (1, 0, 10)
sqla_110 = _vers >= (1, 1, 0)
if sqla_08:
diff --git a/docs/build/changelog.rst b/docs/build/changelog.rst
index 6cec111..9a4b152 100644
--- a/docs/build/changelog.rst
+++ b/docs/build/changelog.rst
@@ -7,6 +7,14 @@ Changelog
:version: 0.9.3
:released:
+ .. change:: 431
+ :tags: bug, tests
+ :tickets: 431
+
+ Fixed unit tests to run correctly under the SQLAlchemy 1.0.x series
+ prior to version 1.0.10 where a particular bug involving Postgresql
+ exclude constraints was fixed.
+
.. changelog::
:version: 0.9.2
:released: May 18, 2017
diff --git a/tests/test_postgresql.py b/tests/test_postgresql.py
index 2ceeaa9..f02deeb 100644
--- a/tests/test_postgresql.py
+++ b/tests/test_postgresql.py
@@ -104,7 +104,7 @@ class PostgresqlOpTest(TestBase):
'("SomeColumn" WITH >) WHERE ("SomeColumn" > 5)'
)
- @config.requirements.fail_before_sqla_100
+ @config.requirements.fail_before_sqla_1010
def test_create_exclude_constraint_quoted_column(self):
context = op_fixture("postgresql")
op.create_exclude_constraint(