summaryrefslogtreecommitdiff
path: root/test/sql/test_query.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/sql/test_query.py')
-rw-r--r--test/sql/test_query.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 50e7eece7..9f0c2dab0 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -749,6 +749,19 @@ class QueryTest(fixtures.TestBase):
eq_(r[users.c.user_name], 'jack')
eq_(r.user_name, 'jack')
+ def test_column_accessor_err(self):
+ r = testing.db.execute(select([1])).first()
+ assert_raises_message(
+ AttributeError,
+ "Could not locate column in row for column 'foo'",
+ getattr, r, "foo"
+ )
+ assert_raises_message(
+ KeyError,
+ "Could not locate column in row for column 'foo'",
+ lambda: r['foo']
+ )
+
@testing.requires.dbapi_lastrowid
def test_native_lastrowid(self):
r = testing.db.execute(