summaryrefslogtreecommitdiff
path: root/tests/test_cursor.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | callproc: tests, docs, and comment/error-reporting touchups.mrmilosz2015-12-121-0/+37
|/
* Allow pickling of cursor.descriptionOwen Raccuglia2015-02-081-0/+11
| | | | | | | | | This is for people using dtuple.py; a dtuple.DatabaseTuple instance keeps a reference to cursor.description, which is not picklable because psycopg2 doesn't export the Column namedtuple it uses. This commit exports the Column namedtuple, and includes a test to verify the pickle/unpickle works after exporting Column.
* Added test to verify withhold cursors work in autocommitDaniele Varrazzo2014-08-211-0/+22
|
* Added test to verify withhold transaction behaviourDaniele Varrazzo2014-08-211-4/+30
| | | | | A withhold cursor can read its data when the transaction is closed, so it shouldn't start a new one upon movement/close.
* Added test with objects without length as callproc paramDaniele Varrazzo2014-06-061-0/+4
|
* Don't segfault on uninitialized cursorDaniele Varrazzo2014-02-261-0/+14
| | | | | | | It can happen with bad cursor subclasses not calling super's init. Raise an exception instead of segfaulting. Closes #195
* Really test named cursors in test_scroll_named()Daniele Varrazzo2013-10-161-3/+1
|
* Skip tests on python implementations without getrefcount()Daniele Varrazzo2013-05-061-1/+3
| | | | PyPy is one of these.
* Testing boilerplate unified in a single base classDaniele Varrazzo2013-04-071-9/+3
| | | | | The class makes a connection always available, allows creating new connection and closes everything on tear down.
* 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
|
* 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.
* close() methods don't raise errors if called on closed objectsDaniele Varrazzo2012-03-041-0/+6
|
* 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.
* Added tests for cursor scrollDaniele Varrazzo2011-12-261-0/+49
|
* 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.
* Test and document the named cursor stealing techniqueDaniele Varrazzo2011-10-141-0/+14
|
* Fixed tests to run with antebellum Postgres versionsDaniele Varrazzo2011-10-051-7/+9
|
* WITH HOLD documentation a argument parsing changesFederico Di Gregorio2011-08-101-2/+0
| | | | Now any true value will do for the withhold parameter.
* New 'withhold' parameter for connection.cursor()Federico Di Gregorio2011-08-101-1/+13
|
* First try at curs.withhold implementationFederico Di Gregorio2011-07-051-0/+21
|
* Correctly detect an empty query sent to the backendDaniele Varrazzo2011-03-041-0/+6
| | | | Closes ticket #46.
* Fixed test for execution with older PostgreSQL versionsDaniele Varrazzo2011-02-231-1/+2
|
* The cursor name can be a non-valid PostgreSQL identifierDaniele Varrazzo2011-02-231-0/+10
|
* Provide cursor.description as named tuple if possibleDaniele Varrazzo2011-02-191-1/+37
| | | | If namedtuple() is not available, use regular tuples.
* Some cleanup in mogrifyDaniele Varrazzo2011-02-181-0/+11
| | | | | | | | | | | | | | | | | - Raise an exception on incomplete placeholders. - Minor speedups. - Don't change the string in place (??!!) if the placeholder is not s and the value is null. The latter point can be done because downstream we don't accept anything different from s anyway (in the Bytes_Format function). Notice that now the format string is constant whatever the arguments. This means that executemany is still more inefficient than it should be as mogrify may work only on the parameters. However this is an implementation only worthwhile if we start supporting real parameters. Let's talk about that for the next release.
* Added cursor.itersizeDaniele Varrazzo2011-02-171-3/+3
| | | | | | | The value is used to control the number of records to fetch per network roundtrip in named cursors iteration. Used to avoid the inefficient arraysize default of 1 without giving this value the magic meaning of 2000.
* Cleanup of skipping of testing methods on certain Py/PG versionsDaniele Varrazzo2011-02-151-2/+4
|
* Skip test if clock_timestamp function is not availableDaniele Varrazzo2011-02-151-1/+2
|
* Work around a 2to3 next fixer bug in a testDaniele Varrazzo2011-02-111-2/+2
|
* Merge branch 'python3' into python2Federico Di Gregorio2011-02-061-14/+15
|\
| * Merge branch 'python2' into python3Daniele Varrazzo2011-01-101-0/+22
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: NEWS-2.3 tests/__init__.py tests/test_lobject.py tests/test_quote.py tests/testutils.py
| * \ Merge branch 'python2' into python3Daniele Varrazzo2011-01-031-0/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: NEWS-2.3 psycopg/connection_type.c tests/test_connection.py tests/types_basic.py
| * \ \ Merge branch 'python2' into python3Daniele Varrazzo2011-01-021-0/+32
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: NEWS-2.3 setup.py
| * | | | Several tests ported to Python 3.Daniele Varrazzo2010-12-311-11/+12
| | | | |
| * | | | Test suite converted into a proper package.Daniele Varrazzo2010-12-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dropped cyclic import from modules to tests: they were only working because a second copy of the package was found in the project dir. Use relative import so that 2to3 can do a good conversion.
| * | | | Some light cleanup for Py3 conversion.Daniele Varrazzo2010-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | Either flagged as warning by python2.6 -3 or converted by 2to3.
* | | | | Fetch 'arraysize' records per roundtrip in named cursors iterationDaniele Varrazzo2011-02-051-0/+15
| | | | | | | | | | | | | | | | | | | | Closes ticket #33.
* | | | | Added test to verify named cursor efficiency.Daniele Varrazzo2011-02-011-0/+14
| |_|_|/ |/| | | | | | | | | | | Iter shouldn't fetch one record at time.
* | | | Added license to unit testsDaniele Varrazzo2011-01-091-0/+22
| | | | | | | | | | | | | | | | As the test suite is now part of the source distribution.
* | | | All tests made executable.Daniele Varrazzo2011-01-071-0/+0
| |_|/ |/| |
* | | The cursor is weakly referenceableDaniele Varrazzo2011-01-031-0/+7
| |/ |/|
* | Added cursor.cast() methodDaniele Varrazzo2011-01-011-0/+32
|/ | | | | The method exposes the typecasters lookup algorithm. Useful to create recursive typecasters.
* More careful connections handling during tests.Daniele Varrazzo2010-11-281-6/+8
|
* Added test to verify the ticket #7 is fixed.Daniele Varrazzo2010-11-061-0/+13
|
* cursor.mogrify() accepts unicode queries.Daniele Varrazzo2010-10-051-0/+31
|
* Added test to verify executemany doesn't propagate exceptions.Daniele Varrazzo2010-07-091-0/+29