Skip to content

Commit

Permalink
Added some tests for cursor.description
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jul 8, 2011
1 parent 73857b3 commit 89ed246
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_cursor.py
Expand Up @@ -164,6 +164,16 @@ def test_integrity_error(self, connection):
with py.test.raises(connection.IntegrityError):
cursor.execute("INSERT INTO people (uid) VALUES (1)")

def test_description(self, connection):
with self.create_table(connection, "people", uid="INT"):
with contextlib.closing(connection.cursor()) as cursor:
cursor.execute("DELETE FROM people WHERE uid = %s", (1,))
assert cursor.description is None

cursor.execute("SELECT uid FROM people")
assert len(cursor.description) == 1
assert cursor.description[0][0] == "uid"

class TestDictCursor(BaseMySQLTests):
def test_fetchall(self, connection):
with self.create_table(connection, "people", name="VARCHAR(20)", age="INT"):
Expand Down

0 comments on commit 89ed246

Please sign in to comment.