[TIP] Mocking a cursor for use with Psycopg2
7h3kk1d at gmail.com
Thu Mar 13 09:29:33 PDT 2014
I'm trying to mock access to my postgres database using the mock framework.
I saw the cursor example
The psycopg2 cursor however does not return the data set but is iterated
over example here <http://initd.org/psycopg/docs/cursor.html> under result
retrieval methods. What would be the best way to mock a cursor which can be
called with a function but also be iterated over.
Thanks for any assistance and sorry for the inexperienced question.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python