We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a370d45 commit dc9abeaCopy full SHA for dc9abea
tests.py
@@ -204,6 +204,17 @@ def test_we_close_the_cursor(self):
204
, cursor.fetchall
205
)
206
207
+ def test_monkey_patch_execute(self):
208
+ expected = "SELECT 1"
209
+ def execute(this, sql, params=[]):
210
+ return sql
211
+ from postgres.cursors import SimpleCursorBase
212
+ SimpleCursorBase.execute = execute
213
+ with self.db.get_cursor() as cursor:
214
+ actual = cursor.execute(expected)
215
+ del SimpleCursorBase.execute
216
+ assert actual == expected
217
+
218
219
# db.get_connection
220
# =================
0 commit comments