[FIX] sql_db: add `closed` property on `Cursor`.

This commit is contained in:
Christophe Simonis 2015-05-08 16:38:46 +02:00
parent 4e015bd96e
commit 1b5576af46
1 changed files with 6 additions and 0 deletions

View File

@ -402,6 +402,12 @@ class Cursor(object):
def __getattr__(self, name):
return getattr(self._obj, name)
@property
def closed(self):
# NOTE: we cannot use `__getattr__` delegation as we
# should not `check` that the cursor is closed
return self._obj.closed
class TestCursor(Cursor):
""" A cursor to be used for tests. It keeps the transaction open across
several requests, and simulates committing, rolling back, and closing.