diff options
Diffstat (limited to 'test/sql/test_selectable.py')
| -rw-r--r-- | test/sql/test_selectable.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py index 04c0e6102..a4d3e1b40 100644 --- a/test/sql/test_selectable.py +++ b/test/sql/test_selectable.py @@ -28,6 +28,7 @@ from sqlalchemy import type_coerce from sqlalchemy import TypeDecorator from sqlalchemy import union from sqlalchemy import util +from sqlalchemy.sql import Alias from sqlalchemy.sql import column from sqlalchemy.sql import elements from sqlalchemy.sql import expression @@ -871,6 +872,18 @@ class SelectableTest( Table("t1", MetaData(), c1) eq_(c1._label, "t1_c1") + def test_no_alias_construct(self): + a = table("a", column("x")) + + assert_raises_message( + NotImplementedError, + "The Alias class is not intended to be constructed directly. " + r"Please use the alias\(\) standalone function", + Alias, + a, + "foo", + ) + class RefreshForNewColTest(fixtures.TestBase): def test_join_uninit(self): |
