summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Raise TypeError instead of InterfaceError on bad params on connect()Daniele Varrazzo2012-09-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Dropped quirks in connection arguments handlingDaniele Varrazzo2012-09-251-0/+8
|/ / | | | | | | | | | | | | Now connect() raises an exception instead of swallowing keyword arguments when a connection string is specified as well Closes ticket #131.
* | Merge branch 'fix-array-parsing' into develDaniele Varrazzo2012-09-201-0/+7
|\ \ | |/ |/|
| * Fixed infinite loop when parsing '{' as arrayDaniele Varrazzo2012-09-201-1/+1
| |
| * Fixed return value after malformed arraysDaniele Varrazzo2012-09-201-0/+7
| |
* | Fixed tests to run with PG 8.3Daniele Varrazzo2012-09-041-4/+4
|/
* Added support with cursors without scroll clauseDaniele Varrazzo2012-08-151-1/+27
| | | | | Using nothing is different from NO SCROLL, see DECLARE notes in PG docs.
* Added test for scrollable cursorDaniele Varrazzo2012-08-151-0/+39
|
* Fixed tpc_recover() with RealDictStuffDaniele Varrazzo2012-08-141-2/+16
| | | | Same problem and correction of ticket #114.
* Fixed register_hstore and register_composite with non-dbapi objectsDaniele Varrazzo2012-08-141-0/+48
| | | | Closed ticket #114.
* Added tests to verify cursor() arguments propagationDaniele Varrazzo2012-04-111-0/+16
|
* Name can be passed as None to cursor()Daniele Varrazzo2012-04-111-0/+4
| | | | | | | | Makes invocation from subclasses and generic code easier. Code simplified by using default values for keyword arguments and avoiding needless conversions back and forth between Python and C strings. Also added connection type check to cursor's init.
* Merge branch 'close-idempotent' into develDaniele Varrazzo2012-03-053-1/+15
|\
| * close() methods don't raise errors if called on closed objectsDaniele Varrazzo2012-03-042-0/+12
| |
| * Dropped test about close() on closed connection raising an exceptionDaniele Varrazzo2012-03-041-1/+3
| | | | | | | | | | | | This seems unnecessary and has caused problems to a few. The DB-SIG seems agreeing on the change: http://mail.python.org/pipermail/db-sig/2011-October/005811.html
* | Update all links to PostgreSQL docs to the current version.Marti Raudsepp2012-02-281-2/+2
|/ | | | I also checked all links and anchors to make sure they're still valid.
* Check/set connection status at commit inside the critical sectionDaniele Varrazzo2012-02-241-0/+29
| | | | | | Failing to do so was causing the issue reported in ticket #103. The issue as reported was fixed when SET ISOLATION LEVEL was dropped, but the real problem wasn't fixed.
* Added support for inet arrayDaniele Varrazzo2012-02-231-0/+9
|
* Fixed inet test that wasn't testing anythingDaniele Varrazzo2012-02-231-2/+2
|
* Fixed exception testing on Python 3Daniele Varrazzo2012-02-231-4/+6
| | | | | ...and so caught exceptions are local to the except suite in Py3. (Lo sapevate? Sapevatelo!)
* Fixed NamedTupleCursor rownumber during iteration.Daniele Varrazzo2012-02-231-1/+30
| | | | | | | The correction is similar to the other one for the other subclasses. Also added tests for rowcount and rownumber during different fetch styles. Just in case.
* Fixed rownumber for cursor subclasses during iterationsDaniele Varrazzo2012-02-231-0/+28
| | | | | | | Regression introduced to fix ticket #80. Don't use fetchmany to get the chunks of values. I did it that way because I was ending up into infinite recursion calling __iter__ from __iter__: the solution has been the "while 1: yield next()" idiom.
* Added test to check rowcount behaves fine during named cursor iterationDaniele Varrazzo2012-02-231-0/+11
| | | | | | Actually *it doesn't*: once we iterate the first itersize records, rowcount is reset to zero. If we want to fix it we need an extra member in the cursor.
* Test methods reordered to improve readabilityDaniele Varrazzo2012-02-231-27/+29
|
* Cache FixedOffsetTimezone instancesMenno Smits2012-01-301-0/+7
| | | | | | | Avoid creating new a new FixedOffsetTimezone instance if one with the same offset and name has been created before. This will save memory when returning many rows containing "timestamp with timezone" columns, and also improves comparability.
* Fixed repr for FixedOffsetTimezone for offsets west of UTC (negative)Menno Smits2012-01-301-1/+20
| | | | | | | | The offset displayed was always positive and somewhat confusing. The offset displayed now is the offset that the instance was created with. Also added some tests for initialisation.
* Renamed shadowed test methodMenno Smits2012-01-291-1/+1
|
* Make Error and subclasses picklableDaniele Varrazzo2012-01-141-1/+34
| | | | | Useful for multiprocessing interaction. Closes ticket #90.
* Dropped duplicate importDaniele Varrazzo2012-01-141-2/+1
|
* Added tests to verify ticket #84Daniele Varrazzo2012-01-101-0/+24
| | | | fetchmany() with no arg is broken in cursor subclasses.
* Force GC during weakref testsDaniele Varrazzo2011-12-262-0/+4
| | | | | Required to run the tests under PyPy with no refcount. See https://github.com/mvantellingen/psycopg2-ctypes/pull/15#issuecomment-3274618
* Added tests for cursor scrollDaniele Varrazzo2011-12-261-0/+49
|
* 'register_composite()' also works with tablesDaniele Varrazzo2011-12-151-0/+45
| | | | Skip dropped and hidden columns when inspecting the schema.
* Fixed error in schema mismatch in composite casterDaniele Varrazzo2011-12-151-0/+10
|
* Put back a distinct ISOLATION_LEVEL_READ_UNCOMMITTED valueDaniele Varrazzo2011-12-151-4/+9
|
* Reverted isolation level values to backward compatible valuesFederico Di Gregorio2011-12-151-9/+4
| | | | | | | | This basically removes the READ UNCOMMITED level (that internally PostgreSQL maps to READ COMMITED anyway) to keep the numeric values compattible with old psycopg versions. For full details and discussion see this thread: http://archives.postgresql.org/psycopg/2011-12/msg00008.php
* Named DictCursor/RealDictCursor honour itersizeDaniele Varrazzo2011-12-111-0/+25
| | | | Closes ticket #80.
* Fixed reference leak with arguments referenced more than once in queriesDaniele Varrazzo2011-12-111-0/+12
| | | | | | Plus, some more care in objects life cycle, mostly in exceptions handling. Closes ticket #81.
* Tests in orderDaniele Varrazzo2011-11-181-23/+22
| | | | Just to know where to put the next one
* Added test to check connect() with no parametersDaniele Varrazzo2011-11-171-0/+7
|
* Escape parameters to the connection strings as required by PQconnectdbDaniele Varrazzo2011-11-171-0/+20
|
* Added test module to verify the dsn manipulationDaniele Varrazzo2011-11-172-0/+109
|
* Check for connection closed before getting the isolation levelDaniele Varrazzo2011-11-161-0/+29
| | | | | | | Closes ticket #74 Also added test to check regressions in isolation_level, set_isolation_level, set_session, autocommit.
* Work around mxDateTime 3.2.0 segfault in testsDaniele Varrazzo2011-11-011-6/+6
|
* Unregister the composite array caster after the testDaniele Varrazzo2011-10-191-1/+6
| | | | Otherwise the refcount script will report a leak.
* Test suite fixed to make it compatible with the ctypes implementationDaniele Varrazzo2011-10-191-6/+9
|
* All unit test modules have a test_ prefixDaniele Varrazzo2011-10-196-10/+10
| | | | Both for consistency and for test discovery.
* Test and document the named cursor stealing techniqueDaniele Varrazzo2011-10-141-0/+14
|
* Skip test on array of records on PG 8.3Daniele Varrazzo2011-10-051-1/+1
|
* Fixed tests to run with antebellum Postgres versionsDaniele Varrazzo2011-10-052-7/+16
|