diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2020-03-19 21:46:56 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-03-19 21:46:56 +0000 |
commit | 1410145d551c4be621840f7339fc45483aababb9 (patch) | |
tree | ec28ee0fbd6d1eb2828a454529b55a19c1be1a9a /tests | |
parent | 28f38dc40df18e6abe99e29edbc3fc561243162f (diff) | |
parent | 52ef05c936170109f2f457751f4940e4269595c3 (diff) | |
download | alembic-1410145d551c4be621840f7339fc45483aababb9.tar.gz |
Merge "Use looser tokenization for type comparison"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/requirements.py | 16 | ||||
-rw-r--r-- | tests/test_autogen_diffs.py | 36 |
2 files changed, 52 insertions, 0 deletions
diff --git a/tests/requirements.py b/tests/requirements.py index bd258e0..d6794a5 100644 --- a/tests/requirements.py +++ b/tests/requirements.py @@ -99,6 +99,22 @@ class DefaultRequirements(SuiteRequirements): return exclusions.only_on(["postgresql"]) @property + def postgresql(self): + return exclusions.only_on(["postgresql"]) + + @property + def mysql(self): + return exclusions.only_on(["mysql"]) + + @property + def oracle(self): + return exclusions.only_on(["oracle"]) + + @property + def mssql(self): + return exclusions.only_on(["mssql"]) + + @property def postgresql_uuid_ossp(self): def check_uuid_ossp(config): if not exclusions.against(config, "postgresql"): diff --git a/tests/test_autogen_diffs.py b/tests/test_autogen_diffs.py index e1e5c8d..ad38765 100644 --- a/tests/test_autogen_diffs.py +++ b/tests/test_autogen_diffs.py @@ -786,6 +786,8 @@ class CompareMetadataToInspectorTest(TestBase): # that have not changed. is_(self._compare_columns(cola, cola), False) + # TODO: ideally the backend-specific types would be tested + # within the test suites for those backends. @testing.combinations( (String(32), VARCHAR(32), False), (VARCHAR(6), String(6), False), @@ -795,6 +797,40 @@ class CompareMetadataToInspectorTest(TestBase): (Unicode(32), VARCHAR(32), False, config.requirements.unicode_string), (VARCHAR(6), VARCHAR(12), True), (VARCHAR(6), String(12), True), + (Integer(), String(10), True), + (String(10), Integer(), True), + ( + Unicode(30, collation="en_US"), + Unicode(30, collation="en_US"), + False, # unfortunately dialects don't seem to consistently + # reflect collations right now so we can't test for + # positives here + config.requirements.postgresql, + ), + ( + mysql.VARCHAR(200, charset="utf8"), + Unicode(200), + False, + config.requirements.mysql, + ), + ( + mysql.VARCHAR(200, charset="latin1"), + mysql.VARCHAR(200, charset="utf-8"), + True, + config.requirements.mysql + config.requirements.sqlalchemy_13, + ), + ( + String(255, collation="utf8_bin"), + String(255), + False, + config.requirements.mysql, + ), + ( + String(255, collation="utf8_bin"), + String(255, collation="latin1_bin"), + True, + config.requirements.mysql + config.requirements.sqlalchemy_13, + ), ) def test_string_comparisons(self, cola, colb, expect_changes): is_(self._compare_columns(cola, colb), expect_changes) |