Commit Graph

17 Commits

Author SHA1 Message Date
Daniele Varrazzo
345077d5f7 Fixed pickling of exceptions with no pgerror/pgcode set
Fixes ticket #170.
2013-07-19 16:05:59 +01:00
Daniele Varrazzo
a44db81d9b Skip tests on python implementations without getrefcount()
PyPy is one of these.
2013-05-06 10:39:24 +01:00
Daniele Varrazzo
0e06addc9f Testing boilerplate unified in a single base class
The class makes a connection always available, allows creating
new connection and closes everything on tear down.
2013-04-07 00:23:30 +01:00
Daniele Varrazzo
73949cd1b8 Merge branch 'diagnostics' into devel 2013-03-20 01:47:14 +00:00
Daniele Varrazzo
114c62fac8 Added tests to verify the new Diagnostics properties
diag can be used on exceptions raised without cursor and is independent from
the cursor.

Docs updated to reflect the changes.
2013-03-20 00:03:58 +00:00
Daniele Varrazzo
294e7ae080 Tests tweaked to run on all the supported versions 2013-03-18 10:06:07 +00:00
Daniele Varrazzo
70b756b8c7 Added test to verify Diagnostics works after copy errors 2013-03-18 00:31:25 +00:00
Daniele Varrazzo
660386929f Added test to verify Diagnostics reference disposal 2013-03-18 00:24:46 +00:00
Daniele Varrazzo
42b063b562 Added all supported properties to the Diagnostic object 2013-03-17 23:58:10 +00:00
Matthew Woodcraft
c75a3bbab4 Work-in-progress support for retrieving PG_DIAG result error fields. 2013-03-17 16:41:15 +00:00
Daniele Varrazzo
20d3d0f66d Raise TypeError instead of InterfaceError on bad params on connect()
TypeError is the standard Python error raised in this case:

    $ python -c "(lambda a: None)(b=10)"
    TypeError: <lambda>() got an unexpected keyword argument 'b'

We only used to raise InterfaceError when connect was used without
any parameter at all, so it's hard to think a program depending on
that design. Furthermore the function has always raised (and still
does) OperationalError too, if the bad argument is detected by the
libpq, and that cannot be changed because we can't tell the
difference from a normal connection error.
2012-09-26 11:55:21 +01:00
Daniele Varrazzo
cd316a94f1 Dropped quirks in connection arguments handling
Now connect() raises an exception instead of swallowing keyword arguments
when a connection string is specified as well

Closes ticket #131.
2012-09-25 23:46:46 +01:00
Daniele Varrazzo
98d6d96ee3 Fixed exception testing on Python 3
...and so caught exceptions are local to the except suite in Py3.
(Lo sapevate? Sapevatelo!)
2012-02-23 23:15:42 +00:00
Daniele Varrazzo
43daba38e7 Make Error and subclasses picklable
Useful for multiprocessing interaction.
Closes ticket #90.
2012-01-14 17:34:09 +00:00
Daniele Varrazzo
417203f68e Added test to check connect() with no parameters 2011-11-17 21:51:24 +00:00
Daniele Varrazzo
625cc1b402 Escape parameters to the connection strings as required by PQconnectdb 2011-11-17 21:51:24 +00:00
Daniele Varrazzo
99ac79511c Added test module to verify the dsn manipulation 2011-11-17 21:51:24 +00:00