mirror of
https://github.com/sprockets/sprockets-postgres.git
synced 2024-11-25 11:19:51 +00:00
664bedbb24
ProgrammingError is raised when you try and fetch data from a cursor and there is no data to fetch. When this happens ProgrammingError.pgcode is None. It is also raised when your query has errors in it. Now if that's the case, they will be caught on L249 and not inside the function at L259. This new branch in the code will ensure that should we unexpectedly encounter a "real" programming error from Postgres, it is not blindly swallowed and a warning is issued. This should NEVER happen based upon my understanding of the psycopg2 internals. Unfortunately I couldn't come up with a good test case using mocks to make it happen, as ProgrammingError() takes no keyword arguments and pgcode is a read-only attribute on a ProgrammingError instance. I also couldn't figure out a way to raise ProgrammingError from psycopg2.errors.lookup/1. Thus, the # pragma: nocover |
||
---|---|---|
.. | ||
testing.sql |