Fix name of lobject keyword argument

This commit is contained in:
Frazer McLean 2017-04-16 03:12:18 +02:00
parent 4b4d2796b7
commit 38cd720369
2 changed files with 8 additions and 1 deletions

View File

@ -938,7 +938,7 @@ psyco_conn_lobject(connectionObject *self, PyObject *args, PyObject *keywds)
PyObject *obj;
static char *kwlist[] = {"oid", "mode", "new_oid", "new_file",
"cursor_factory", NULL};
"lobject_factory", NULL};
if (!PyArg_ParseTupleAndKeywords(args, keywds, "|IzIzO", kwlist,
&oid, &smode, &new_oid, &new_file,

View File

@ -382,6 +382,13 @@ class LargeObjectTests(LargeObjectTestCase):
except psycopg2.OperationalError:
pass
def test_factory(self):
class lobject_subclass(psycopg2.extensions.lobject):
pass
lo = self.conn.lobject(lobject_factory=lobject_subclass)
self.assertIsInstance(lo, lobject_subclass)
decorate_all_tests(LargeObjectTests, skip_if_no_lo, skip_lo_if_green)