diff options
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r-- | test/dialect/postgresql/test_reflection.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 311835dae..ae1dff6d0 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -28,6 +28,7 @@ from sqlalchemy.dialects.postgresql import TSRANGE from sqlalchemy.engine import reflection from sqlalchemy.sql.schema import CheckConstraint from sqlalchemy.testing import fixtures +from sqlalchemy.testing import mock from sqlalchemy.testing.assertions import assert_raises from sqlalchemy.testing.assertions import AssertsExecutionResults from sqlalchemy.testing.assertions import eq_ @@ -1424,6 +1425,20 @@ class ReflectionTest(fixtures.TestBase): }, ) + def test_reflect_check_warning(self): + conn = mock.Mock( + execute=lambda *arg, **kw: mock.Mock( + fetchall=lambda: [("some name", "NOTCHECK foobar")] + ) + ) + with mock.patch.object( + testing.db.dialect, "get_table_oid", lambda *arg, **kw: 1 + ): + with testing.expect_warnings( + "Could not parse CHECK constraint text: 'NOTCHECK foobar'" + ): + testing.db.dialect.get_check_constraints(conn, "foo") + class CustomTypeReflectionTest(fixtures.TestBase): class CustomType(object): |