summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'fix-558'Daniele Varrazzo2017-06-161-0/+21
|\
| * Consider redshift interval supported after further testsDaniele Varrazzo2017-06-161-1/+3
| |
| * Parse a number as microseconds when casting intervalbug-558Daniele Varrazzo2017-06-161-0/+19
| | | | | | | | | | | | Should close #558, but I'm curious to know if a number is returned for interval < 1 day too (which wouldn't trigger the overflow, but will finish parsing with part=0).
* | Added Json.prepare()fix-562Daniele Varrazzo2017-06-161-0/+18
|/ | | | Close #562
* Don't force a valid return code for the testDaniele Varrazzo2017-06-151-1/+1
| | | | Windows returns 22, Linux returns 1
* Added test to reproduce bug #551Daniele Varrazzo2017-06-151-1/+57
|
* Merge branch 'fix-547'Daniele Varrazzo2017-04-191-0/+23
|\
| * Fixed args parsing in ReplicationCursor.consume_stream()Daniele Varrazzo2017-04-191-0/+23
| | | | | | | | Close #547.
* | Merge remote-tracking branch 'fix_lobject_factory'Daniele Varrazzo2017-04-191-0/+7
|\ \
| * | Python < 3.2 doesn’t have assertIsInstanceFrazer McLean2017-04-161-1/+1
| | |
| * | Fix name of lobject keyword argumentFrazer McLean2017-04-161-0/+7
| |/
* | Handle lobject mode=None correctlyFrazer McLean2017-04-161-0/+7
|/
* Added test to verify callback errors in named cursorsDaniele Varrazzo2017-04-051-0/+17
| | | | They work fine.
* Added test to verify #410Daniele Varrazzo2017-04-051-0/+68
| | | | The 'unknown error' happens on query.
* Return objects with timezone parsing infinity timestamptzDaniele Varrazzo2017-03-221-0/+19
| | | | Close #536.
* Merge branch 'fix-528'Daniele Varrazzo2017-03-161-0/+37
|\
| * Obscure the password on url dsn tooDaniele Varrazzo2017-03-161-7/+4
| | | | | | | | | | | | Note that we don't leak anymore the password length. Fix #528
| * Added tests to verify the password is obscuredDaniele Varrazzo2017-03-151-0/+40
| | | | | | | | The url test fails: see issue #528
* | Added test to verify sql objects work with copy_expert()Daniele Varrazzo2017-03-161-1/+25
|/ | | | | | I'll be honest: I lucked out, I didn't think about this combination. But maybe sheer luck, maybe using common code paths, it just works. Let's make it stays so.
* Bunch of test tweaks to make the test grid greenDaniele Varrazzo2017-03-142-12/+14
|
* Always raise OperationalError when connection was closed externally.Greg Ward2017-03-141-1/+1
| | | | | | | | | | | | | | | From the DB-API (https://www.python.org/dev/peps/pep-0249/): OperationalError Exception raised for errors that are related to the database's operation and not necessarily under the control of the programmer, e.g. an unexpected disconnect occurs, [...] Additionally, psycopg2 was inconsistent, at least in the async case: depending on how the "connection closed" error was reported from the kernel to libpq, it would sometimes raise OperationalError and sometimes DatabaseError. Now it always raises OperationalError.
* Always detect when a connection is closed behind psycopg2's back.Greg Ward2017-03-141-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a race condition that only seems to happen over Unix-domain sockets. Sometimes, the closed socket is reported by the kernel to libpq like this (captured with strace): sendto(3, "Q\0\0\0\34select pg_backend_pid()\0", 29, MSG_NOSIGNAL, NULL, 0) = 29 recvfrom(3, "E\0\0\0mSFATAL\0C57P01\0Mterminating "..., 16384, 0, NULL, NULL) = 110 recvfrom(3, 0x12d0330, 16384, 0, 0, 0) = -1 ECONNRESET (Connection reset by peer) That is, psycopg2/libpq sees no error when sending the first query after the connection is closed, but gets an error reading the result. In that case, everything worked fine. But sometimes, the error manifests like this: sendto(3, "Q\0\0\0\34select pg_backend_pid()\0", 29, MSG_NOSIGNAL, NULL, 0) = -1 EPIPE (Broken pipe) recvfrom(3, "E\0\0\0mSFATAL\0C57P01\0Mterminating "..., 16384, 0, NULL, NULL) = 110 recvfrom(3, "", 16274, 0, NULL, NULL) = 0 recvfrom(3, "", 16274, 0, NULL, NULL) = 0 i.e. libpq received an error when sending the query. This manifests as a slightly different exception from a slightly different place. More importantly, in this case connection.closed is left at 0 rather than being set to 2, and that is the bug I'm fixing here. Note that we see almost identical behaviour for sync and async connections, and the fixes are the same. So I added extremely similar test cases. Finally, there is still a bug here: for async connections, we sometimes raise DatabaseError (incorrect) and sometimes raise OperationalError (correct). Will fix that next.
* Flake8 complaintsDaniele Varrazzo2017-03-141-12/+8
|
* Skip the tests according to the earliest of libpq built/linked.Daniele Varrazzo2017-03-021-1/+1
|
* Merge branch 'no-unittest2'Daniele Varrazzo2017-03-021-8/+1
|\ | | | | | | Close #516
| * Don't try to use unittest2no-unittest2Daniele Varrazzo2017-03-011-8/+1
| | | | | | | | | | Modules importing unittest directly would miss the monkeypatch: see ticket #516.
* | Ignore None arguments passed to make_dsn()fix-517Daniele Varrazzo2017-03-011-0/+4
|/ | | | Close #517.
* Skip test on PG version with bad interval roundingfix-512Daniele Varrazzo2017-03-011-0/+1
| | | | | | | | | On these ancient versions: =# select '999999:00:00.1'::interval; interval -------------------------------- 41666 days 15:00:00.0999999046
* Handle overflow in interval parsingDaniele Varrazzo2017-02-241-0/+18
|
* Parse interval only using integersDaniele Varrazzo2017-02-241-4/+21
| | | | | | | | | (almost... except for micros rounding) While this is probably an improvement on the previous implementation, I am largely waving a dead chicken at windows, which keeps failing to pass the seconds overflow test. If it doesn't pass now either I'll start blaming Python's timedelta.
* Try to fix the same problem in windowsDaniele Varrazzo2017-02-241-1/+20
| | | | | Previous commit doesn't pass on Windows: it looks like window's floor() has an integer overflow.
* Fixed integer overflow in interval typecasterDaniele Varrazzo2017-02-241-0/+4
| | | | Close #512.
* Added readonly and deferrable attributesDaniele Varrazzo2017-02-163-25/+123
|
* Revert pre-2.7b1 behaviour of silent rollback on conn.set_isolation_level()Daniele Varrazzo2017-02-161-6/+26
| | | | Legacy method is legacy.
* connection.isolation_level is now writableDaniele Varrazzo2017-02-161-78/+179
|
* Don't convert '{}'::unknown into an empty listDaniele Varrazzo2017-02-081-4/+6
| | | | Close #506.
* Use pydll to poke into extension libraryDaniele Varrazzo2017-02-071-1/+1
| | | | | | Causes an error in Py 3.6 in debug mode. Close #505
* Merge branch 'no-set-default-session'Daniele Varrazzo2017-02-071-53/+54
|\
| * Set default_transaction_* GUC if session state is changed in autocomitDaniele Varrazzo2017-02-041-24/+25
| |
| * Exposing ISOLATION_LEVEL_DEFAULT to PythonDaniele Varrazzo2017-02-041-1/+1
| | | | | | | | | | This is now the state that is returned to Python if nothing has been explicitly set.
| * Test looking the transactions characteristics instead of the defaultDaniele Varrazzo2017-02-041-28/+28
| | | | | | | | | | | | So we test the effect, not the implementation. Tests pass on master too this way, three tests fail in this branch, related to autocommit (sort-of-obviously).
* | Skipped a couple of tests failing on old dbstest-dinosaursDaniele Varrazzo2017-02-062-0/+2
| | | | | | | | I don't even know why - worth investigating.
* | Skip tests with server not supporting NULL in arrayDaniele Varrazzo2017-02-061-3/+6
| |
* | Don't test with server not implementing INSERT with VALUES listDaniele Varrazzo2017-02-061-4/+8
| |
* | Deal consistently with E'' quotes in testsDaniele Varrazzo2017-02-065-41/+41
| |
* | Work around a race condition in async cancel testDaniele Varrazzo2017-02-062-3/+10
| |
* | assertDsnEqual moved as TestSuite methodDaniele Varrazzo2017-02-064-22/+25
| |
* | Merge branch 'conform-subclass-adapter'Daniele Varrazzo2017-02-051-0/+13
|\ \
| * | Give precedence to '__conform__()' over superclasses choosing adapterDaniele Varrazzo2017-02-051-0/+13
| |/ | | | | | | Close #456
* | Slower timeout for a test that sometimes failDaniele Varrazzo2017-02-051-1/+1
|/ | | | | At least it should fail with an error after 2 seconds, not waiting for Travis timeout of 10 minutes.