(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 = [
(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 = [
)
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",
from sqlalchemy.testing import AssertsCompiledSQL
from sqlalchemy.testing import AssertsExecutionResults
from sqlalchemy.testing import eq_
+from sqlalchemy.testing import eq_regex
from sqlalchemy.testing import fixtures
from sqlalchemy.testing import is_
from sqlalchemy.util import u
meta2 = MetaData(testing.db)
table = Table("mysql_bool", meta2, autoload=True)
eq_(colspec(table.c.b3), "b3 TINYINT(1)")
- eq_(colspec(table.c.b4), "b4 TINYINT(1) UNSIGNED")
+ eq_regex(colspec(table.c.b4), r"b4 TINYINT(?:\(1\))? UNSIGNED")
meta2 = MetaData(testing.db)
table = Table(
eq_(list(row), [1950, 2050, None, 1950])
conn.execute(table.delete())
self.assert_(colspec(table.c.y1).startswith("y1 YEAR"))
- eq_(colspec(table.c.y5), "y5 YEAR(4)")
+ eq_regex(colspec(table.c.y5), r"y5 YEAR(?:\(4\))?")
class JSONTest(fixtures.TestBase):