[FIX] sql_db: add `closed` property on `Cursor`.
This commit is contained in:
parent
4e015bd96e
commit
1b5576af46
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue