summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Python 2 compatibilitycockroachdb-testsDaniele Varrazzo2020-08-171-2/+2
|
* Added possibility to skip a test only on certain crdb versionsDaniele Varrazzo2020-08-171-4/+27
|
* Added ticket numbers for the tests skipped on crdbDaniele Varrazzo2020-08-171-0/+27
|
* Added missing reasons for crdb skipDaniele Varrazzo2020-08-173-7/+10
| | | | Added check to make sure a reason must be passed.
* Added reason for skipping on CockroachDBDaniele Varrazzo2020-07-2719-89/+97
|
* Types tests adapted to CockroachDBDaniele Varrazzo2020-07-232-14/+29
|
* Several other tests skipped for CockroachDBDaniele Varrazzo2020-07-229-14/+34
| | | | The only remaining test modules in this branch are test_types_basic/extra.
* Some extra cursors test skipped on CockroachDBDaniele Varrazzo2020-07-222-3/+21
| | | | Skip named cursor tests
* Skip a few date tests on CockroachDBDaniele Varrazzo2020-07-221-1/+4
| | | | | | - Infinity gets converted to large dates in the past/future out of Python range - Timestamps get an UTC timezone attached
* Cursor tests adapted to CockroachDBDaniele Varrazzo2020-07-211-223/+231
| | | | Named cursor tests separated to skip all in one go
* Get CockroachDB version from the connection infoDaniele Varrazzo2020-07-211-14/+11
|
* Skip copy tests on CockroachDBDaniele Varrazzo2020-07-211-1/+5
|
* Skip connection tests which cannot pass on CockroachDBDaniele Varrazzo2020-07-212-1/+36
| | | | | | | | | | | Features not supported seem: - isolation level (always serializable) - client encodings - notices (maybe there is a way to generate them) - 2 phase commit - reset (because of the lack of transaction deferrable) - backend pid
* Expose libpq PG* vars as testconfig contentDaniele Varrazzo2020-07-211-4/+4
|
* Skip cancel tests on CockroachDBDaniele Varrazzo2020-07-213-8/+12
| | | | One test moved to the async tests module, as it really belongs there.
* All the sync tests pass on CockroachDBDaniele Varrazzo2020-07-212-5/+23
| | | | Added decorator to skip tests on crdb
* Allow most of the async tests to pass on CockroachDBDaniele Varrazzo2020-07-212-1/+38
| | | | Added function to get crdb version from a connection
* Handle failure in setup of IsolationLevelsTestCaseRafi Shamim2020-07-071-3/+5
| | | | | | | | | | | If the CREATE TABLE statement fails, the setup would fail without committing or rolling back the active transaction, so the transaction would hold onto its resources indefinitely. Normally, the transaction would be closed when the connection is closed in the `tearDown` function. However, `tearDown` is not called if there was an error during `setUp` ([as specified by the `unittest` docs](https://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown)), so we need to handle this case specially.
* Handle failure in setup of ConnectionTwoPhaseTestRafi Shamim2020-05-121-3/+5
| | | | | | Previously, this test had a bug, because if the CREATE TABLE statement failed, the setup would fail without committing or rolling back the active transaction.
* Fixed copy() on DictRowfix-1073Daniele Varrazzo2020-04-061-0/+29
| | | | Close #1073.
* Column objects can be slicedcolumn-sliceDaniele Varrazzo2020-03-111-0/+5
| | | | Close #1034.
* Copyright bumped to 2020Daniele Varrazzo2020-01-1728-0/+28
|
* Slow test is slowDaniele Varrazzo2019-10-191-0/+1
|
* Use travis test config variable 0/1 instead of blank stringsDaniele Varrazzo2019-10-191-1/+1
| | | | | Travis web interface doesn't allow anymore to set an empty string as variable value.
* Added decorator to clean up the adaptation mappings after testsfix-948Daniele Varrazzo2019-09-043-132/+89
| | | | | | | Many tests were doing it manually, some weren't doing it and resulted in failure if run in different order. Close #948
* fix `NamedTupleCursor._cached_make_nt`Changaco2019-06-041-1/+1
|
* improve the NamedTupleCursor cache testChangaco2019-06-041-0/+10
|
* Smart replication feedbackAlexander Kukushkin2019-05-062-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes psycopg2 responsible for sending the status update (feedback) messages to the server regardless of whether a synchronous or asynchronous connection is used. Feedback is sent every *status_update* (default value is 10) seconds, which could be configured by passing a corresponding parameter to the `start_replication()` or `start_replication_expert()` methods. The actual feedback message is sent by the `pq_read_replication_message()` when the *status_update* timeout is reached. The default behavior of the `send_feedback()` method is changed. It doesn't send a feedback message on every call anymore but just updates internal structures. There is still a way to *force* sending a message if *force* or *reply* parameters are set. The new approach has certain advantages: 1. The client can simply call the `send_feedback()` for every processed message and the library will take care of not overwhelming the server. Actually, in the synchronous mode it is even mandatory to confirm every processed message. 2. The library tracks internally the pointer of the last received message which is not keepalive. If the client confirmed the last message and after that server sends only keepalives with increasing *wal_end*, the library can safely move forward *flush* position to the *wal_end* and later automatically report it to the server. Reporting of the *wal_end* received from keepalive messages is very important. Not doing so casing: 1. Excessive disk usage, because the replication slot prevents from WAL being cleaned up. 2. The smart and fast shutdown of the server could last indefinitely because walsender waits until the client report *flush* position equal to the *wal_end*. This implementation is only extending the existing API and therefore should not break any of the existing code.
* RealDictRow inherits from OrderedDictfix-886Daniele Varrazzo2019-04-061-1/+16
| | | | | | | | Now its state is unmodified, so apart from special-casing creation and initial population can work unmodified, and all the desired properties just work (modifiability, picklability...) Close #886.
* Fixed RealDictCursor.pop()Daniele Varrazzo2019-04-061-0/+19
| | | | Addresses #886, but there might be something else broken there.
* Test notifies are received ok polling an async curfix-887Daniele Varrazzo2019-04-051-1/+22
|
* Handle ok poll() without a cursor having executed queriesDaniele Varrazzo2019-04-051-0/+4
| | | | Close #887
* Store WAL end pointer in the replication cursorMartins Grunskis2019-03-301-0/+1
|
* Allow tests to be ignored if dynamic binding failed2_8_BETA_2Daniele Varrazzo2019-03-182-14/+23
|
* Merge branch 'fix-829'Daniele Varrazzo2019-03-181-3/+46
|\
| * subprocess test function moved into a moduleDaniele Varrazzo2019-03-171-11/+26
| | | | | | | | | | | | | | | | | | | | | | It won't work on windows if it's in the script: failing with errors such as: AttributeError: 'module' object has no attribute 'process' or: Can't get attribute 'process' on <module '__main__' (built-in)>
| * Added test to reproduce ticket #829Daniele Varrazzo2019-03-171-0/+28
| | | | | | | | | | Unrelated processes close the FD of the connection. This happens in Python 3.6 but not 2.7. Let's see if travis shows where else it fails...
* | Allow incorrect result for pgconn_ptr test on OSXDaniele Varrazzo2019-03-181-0/+3
|/ | | | | | | | I don't know why it returns 0 instead of the right value. At least it doesn't segfault, so don't skip the test altogether. The test is unrelated to this branch: will cherry-pick elsewhere (if I remember it...)
* Added pq_get_result_async() replaced pg_get_last_result()Daniele Varrazzo2019-03-172-2/+74
| | | | | | | | | | | | | | The new function keeps together PQconsumeInput() with PQisBusy(), in order to handle the condition in which not all the results of a sequence of statements arrive in the same roundtrip. Added pointer to a PGresult to the connection to keep the state across async communication: it can probably be used to simplify other code paths where a result is brought forward manually. Close #802 Close #855 Close #856
* Shorter timeout in the async tests selectDaniele Varrazzo2019-03-161-2/+2
|
* Use PY2, PY3 for conditional code instead of sys.version_infoDaniele Varrazzo2019-03-167-49/+37
|
* Use errors module to catch a specific postgres errorDaniele Varrazzo2019-03-161-6/+3
|
* Other import moved to top level in testsDaniele Varrazzo2019-03-1612-77/+44
|
* Dropped repeated conditional import of reload in testDaniele Varrazzo2019-03-161-8/+0
|
* TextIOBase moved to tests compat importsDaniele Varrazzo2019-03-162-11/+8
|
* Move imports to the top of the module across testsJon Dufresne2019-03-1615-171/+48
| | | | | | | | | | Allows removing many duplicate imports and better follows PEP8 guidelines: https://www.python.org/dev/peps/pep-0008/#imports > Imports are always put at the top of the file, just after any module > comments and docstrings, and before module globals and constants.
* Fix invalid exception handler: `except e:`Jon Dufresne2019-03-161-4/+0
| | | | | | | | | | | | Fixes flake8 warning: ./tests/test_connection.py:390:16: F821 undefined name 'e' ./tests/test_connection.py:391:61: F821 undefined name 'e' ./tests/test_connection.py:408:16: F821 undefined name 'e' ./tests/test_connection.py:409:61: F821 undefined name 'e' In the event of an unexpected error, let the exception bubble up the stack for a more informative test failure message.
* Use unittest 'skip' feature to skip mxDateTimeTestsJon Dufresne2019-03-131-13/+4
| | | | | | | | Rather than deleting, the class, use the skip feature. Provides a more informative message during test output. Never skip DatetimeTests as all supported Python environments have the datetime module builtin.
* Remove unused variableJon Dufresne2019-03-131-1/+0
| | | | The variable i is immediately overwritten by the next line.
* Convert `while 1:` statements to `while True:`Jon Dufresne2019-03-131-1/+1
| | | | A slightly more readable and modern syntax.