[PyGreSQL] Changes for DB-API compliance

D'Arcy J.M. Cain darcy at PyGreSQL.org
Sat Sep 18 09:23:29 EDT 2004


I have been making more changes based on running the DB-API unit test
from http://zen.freezope.org/Software/DBAPI20TestSuite/.  Here is the
result of the test so far.

.E...........................F....
======================================================================
ERROR: test_Binary (__main__.test_Psycopg)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/darcy/pubcvs/pygresql/module/dbapi20.py", line 797, in
test_Binary
    b = self.driver.Binary('Something')
AttributeError: 'module' object has no attribute 'Binary'

======================================================================
FAIL: test_rowcount (__main__.test_Psycopg)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/home/darcy/pubcvs/pygresql/module/dbapi20.py", line 277, in
test_rowcount
    'cursor.rowcount should be -1 after executing no-result '
  File "/usr/pkg/lib/python2p3/unittest.py", line 302, in
failUnlessEqual
    raise self.failureException, \
AssertionError: cursor.rowcount should be -1 after executing no-result
statements

----------------------------------------------------------------------
Ran 34 tests in 3.030s

I am not sure how to go about creating a Binary function so if anyone
wants to jump in please do.

As for the second error, I am not sure that the test is correct.  The
spec says that the value of rowcount is undefined after a no-result
statement.  I think the test is wrong here.  Does anyone else think
otherwise?

There were quite a few changes to get to that stage.  Please check the
latest changes.  The latest beta is available from the usual place.

-- 
D'Arcy J.M. Cain
PyGreSQL Development Group
http://www.PyGreSQL.org


More information about the PyGreSQL mailing list