summaryrefslogtreecommitdiff
path: root/tests/test_cursor.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2020-03-11 10:50:56 +1300
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2020-03-11 10:50:56 +1300
commit054123254e49ee5edeb35a2d648fce52755f5afe (patch)
tree3d1c95c35e05905a6f0f747072107a84dfbdbb66 /tests/test_cursor.py
parent5d96b0c02419fb2fd0c8fdee7dad0a5d5f4ac1a9 (diff)
downloadpsycopg2-column-slice.tar.gz
Column objects can be slicedcolumn-slice
Close #1034.
Diffstat (limited to 'tests/test_cursor.py')
-rwxr-xr-xtests/test_cursor.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test_cursor.py b/tests/test_cursor.py
index 4d18096..9bf9ccf 100755
--- a/tests/test_cursor.py
+++ b/tests/test_cursor.py
@@ -433,6 +433,11 @@ class CursorTests(ConnectingTestCase):
self.assertEqual(curs.description[2].table_oid, None)
self.assertEqual(curs.description[2].table_column, None)
+ def test_description_slice(self):
+ curs = self.conn.cursor()
+ curs.execute("select 1::int as a")
+ self.assertEqual(curs.description[0][0:2], ('a', 23))
+
def test_pickle_description(self):
curs = self.conn.cursor()
curs.execute('SELECT 1 AS foo')