diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-08-05 20:32:02 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-08-05 21:16:57 -0400 |
commit | 5668fd73ea51bffbccb8b1ae8923ef2d545efacb (patch) | |
tree | be00a199984cd9b9f69e1d83212eb67ba7ca1800 /test/dialect/mysql/test_reflection.py | |
parent | cc57ea495f6460dd56daa6de57e40047ed999369 (diff) | |
download | sqlalchemy-5668fd73ea51bffbccb8b1ae8923ef2d545efacb.tar.gz |
Fixes for MySQL 8
MySQL 8.0.19 has some changes to how it reports on display widths
for int types (seems like it omits it in some cases), and also
no longer cares about the length for YEAR. Another adjustment
to the ordering of constraints reported in one case also.
At least one CI machine is at 8.0.21 now.
Change-Id: Ie2101bed3ad75dcbb62cd05abe95ef14ad895cf5
Diffstat (limited to 'test/dialect/mysql/test_reflection.py')
-rw-r--r-- | test/dialect/mysql/test_reflection.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/test/dialect/mysql/test_reflection.py b/test/dialect/mysql/test_reflection.py index 2e1b20490..f0465ec50 100644 --- a/test/dialect/mysql/test_reflection.py +++ b/test/dialect/mysql/test_reflection.py @@ -126,7 +126,10 @@ class TypeReflectionTest(fixtures.TestBase): (mysql.YEAR(display_width=4), mysql.YEAR(display_width=4)), ] - self._run_test(specs, ["display_width"]) + if testing.against("mysql>=8.0.19"): + self._run_test(specs, []) + else: + self._run_test(specs, ["display_width"]) def test_string_types(self): specs = [ @@ -193,7 +196,14 @@ class TypeReflectionTest(fixtures.TestBase): (BigInteger, mysql.BIGINT(display_width=20)), ] ) - self._run_test(specs, ["display_width", "unsigned", "zerofill"]) + + # TODO: mysql 8.0.19-ish doesn't consistently report + # on display_width. need to test this more accurately though + # for the cases where it does + if testing.against("mysql >= 8.0.19"): + self._run_test(specs, ["unsigned", "zerofill"]) + else: + self._run_test(specs, ["display_width", "unsigned", "zerofill"]) def test_binary_types(self): specs = [ @@ -949,7 +959,10 @@ class ReflectionTest(fixtures.TestBase, AssertsCompiledSQL): ) else: eq_( - inspect(testing.db).get_foreign_keys("PlaylistTrack"), + sorted( + inspect(testing.db).get_foreign_keys("PlaylistTrack"), + key=lambda elem: elem["name"], + ), [ { "name": "FK_PlaylistTTrackId", |