Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

fix for any uncatchable internal exceptions #134

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,26 @@ def test_getconn_manage_with_exception(self):
pass
self.assertEqual(len(self.db.conns.busy), 0, msg="Some connections were not recycled")

# Bad formed python string
@gen_test
def test_execute(self):
"""Testing execute"""
try:
sql = yield self.conn.execute("SELECT COUNT(*) FROM unittest_large_query WHERE name LIKE %s;", ('%2',))
except psycopg2.Error as error:
pass
try:
search = "WHERE name LIKE '%%s'"
sql = yield self.conn.execute("SELECT COUNT(*) FROM unittest_large_query %s;" % search)
except psycopg2.Error as error:
pass
try:
search = "WHERE name LIKE '%%searchable' LIMIT %s" % 10
sql = yield self.conn.execute("SELECT COUNT(*) FROM unittest_large_query %s;" % search)
except psycopg2.Error as error:
pass



class MomokoPoolDataTestProxy(ProxyMixIn, MomokoPoolDataTest):
pass
Expand Down