summaryrefslogtreecommitdiff
path: root/tests/test_async.py
Commit message (Collapse)AuthorAgeFilesLines
* Unskip tests that work on CockroachDB v22.1Rafi Shamim2022-03-281-3/+3
| | | | CockroachDB supports named cursors in v22.1, so more tests pass.
* Copyright year updated to 2021Daniele Varrazzo2021-06-151-1/+1
| | | | | ag -l Copyright | xargs sed -i \ "s/\(.*copyright (C) [0-9]\+\)\(-[0-9]\+\)\?\(.*Psycopg Team.*\)/\1-$(date +%Y)\3/I"
* Upgrade Python syntax with pyupgrade --py36-plusHugo van Kemenade2020-11-171-2/+1
|
* Added missing reasons for crdb skipDaniele Varrazzo2020-08-171-5/+5
| | | | Added check to make sure a reason must be passed.
* Added reason for skipping on CockroachDBDaniele Varrazzo2020-07-271-0/+1
|
* Skip cancel tests on CockroachDBDaniele Varrazzo2020-07-211-0/+5
| | | | One test moved to the async tests module, as it really belongs there.
* All the sync tests pass on CockroachDBDaniele Varrazzo2020-07-211-5/+10
| | | | Added decorator to skip tests on crdb
* Allow most of the async tests to pass on CockroachDBDaniele Varrazzo2020-07-211-1/+6
| | | | Added function to get crdb version from a connection
* Copyright bumped to 2020Daniele Varrazzo2020-01-171-0/+1
|
* Slow test is slowDaniele Varrazzo2019-10-191-0/+1
|
* 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
* Added pq_get_result_async() replaced pg_get_last_result()Daniele Varrazzo2019-03-171-0/+41
| | | | | | | | | | | | | | 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
* Other import moved to top level in testsDaniele Varrazzo2019-03-161-6/+4
|
* Copyright year updatedDaniele Varrazzo2019-02-171-1/+1
| | | | | ag -l Copyright | xargs sed -i \ "s/\(.*copyright (C) [0-9]\+\)\(-[0-9]\+\)\?\(.*\)/\1-$(date +%Y)\3/I"
* Full flake8 3.5 cleanupDaniele Varrazzo2018-10-231-0/+1
|
* Use the connection.info properties instead of the legacy methodsconnection-infoDaniele Varrazzo2018-10-131-3/+3
|
* Fixed infinite loop in pq_get_last_result after COPYDaniele Varrazzo2018-10-101-0/+6
| | | | | | | There will be an error downstream but we have to get out of this function first. Close #781
* Avoid installing tests to site-packagesJon Dufresne2017-12-101-3/+2
| | | | | | | | For library end users, there is no need to install tests alongside the package itself. This keeps the tests available for development without adding extra packages to user's site-packages directory. Reduces the size of the installed package. Avoids accidental execution of test code by an installed package.
* Use relative imports throughout testsJon Dufresne2017-12-101-2/+2
| | | | | | | | | | | | | | The tests relied on Python2 relative import semantics. Python3 changed import semantics to always search sys.path by default. To import using a relative path it must have a leading dot. Forward compatible with newer Pythons. Works towards the goal of moving tests outside of the installed package. For more information, see PEP-328: https://www.python.org/dev/peps/pep-0328/
* Always import the system unittestJon Dufresne2017-12-011-1/+2
| | | | | | | There is no need to import testutils.unittest instead of simply unittest. They are simple aliases. Use system unittest to be more regular, consistent as well as idiomatic with the wider Python community.
* Use modern except syntax throughout projectJon Dufresne2017-11-201-1/+1
| | | | | | The syntax "except Exception, exc:" is deprecated. All Python versions supported by psycopg2 support the newer, modern syntax. Forward compatible with future Python versions.
* Added readonly and deferrable attributesDaniele Varrazzo2017-02-161-8/+9
|
* Merge branch 'async-keyword'Daniele Varrazzo2017-02-031-8/+8
|\ | | | | | | Close #495
| * Added async_ as an alias for asyncDaniele Varrazzo2017-02-031-8/+8
| | | | | | | | | | Added in argument for psycopg2.connect() and connection.__init__, and for the connection.async attribute.
* | Further skipping of slow testsDaniele Varrazzo2017-02-021-0/+2
| |
* | Allow skipping the slow testmanylinuxDaniele Varrazzo2017-02-021-1/+2
|/ | | | | | | | It's not so much about tests being slow: some just get stuck and timeout travis. Skipped all tests taking about more than 0.2s to run on my laptop. Fast testing takes about 8s instead of 24.
* Python source cleanup using flake8Daniele Varrazzo2016-10-111-4/+6
|
* Fix async replication and test.Oleksandr Shulgin2015-10-151-16/+0
|
* Added select.select timeout on AsyncTests.waitJason Erickson2014-05-191-2/+2
| | | | | | On Windows, the select.select() hangs/waits forever on the test_async_connection_error_message() test. Adding a 10 second timeout allows the tests to continue.
* Meaningful connection errors report a meaningful messageDaniele Varrazzo2013-10-161-0/+10
| | | | Fixes issue #173.
* Testing boilerplate unified in a single base classDaniele Varrazzo2013-04-071-9/+7
| | | | | The class makes a connection always available, allows creating new connection and closes everything on tear down.
* Fix tests for Postgres 9.3Catalin Iacob2013-03-161-0/+3
| | | | | | | Postgres 9.3 turns messages about implicit indexes and sequences from NOTICE to DEBUG1 so the tests fail with a default 9.3 server configuration because the client doesn't get any NOTICE. Fix it by also asking for DEBUG1 messages from the server when testing against Postgres >= 9.3.
* Force GC during weakref testsDaniele Varrazzo2011-12-261-0/+2
| | | | | Required to run the tests under PyPy with no refcount. See https://github.com/mvantellingen/psycopg2-ctypes/pull/15#issuecomment-3274618
* Cleanup of skipping of testing methods on certain Py/PG versionsDaniele Varrazzo2011-02-151-2/+2
|
* Merge branch 'python2' into python3Daniele Varrazzo2011-01-101-0/+24
|\ | | | | | | | | | | | | | | | | Conflicts: NEWS-2.3 tests/__init__.py tests/test_lobject.py tests/test_quote.py tests/testutils.py
| * Added license to unit testsDaniele Varrazzo2011-01-091-0/+24
| | | | | | | | As the test suite is now part of the source distribution.
* | Merge branch 'python2' into python3Daniele Varrazzo2011-01-031-0/+12
|\ \ | |/ | | | | | | | | | | | | Conflicts: NEWS-2.3 psycopg/connection_type.c tests/test_connection.py tests/types_basic.py
| * Broken circular reference in async executionDaniele Varrazzo2011-01-031-0/+12
| | | | | | | | | | | | If a connection is destroyed before an async operation is completed, the `async_cursor` member creates a reference loop, leaving the connection and the cursor alive. `async_cursor` is now a weak reference.
* | Test suite converted into a proper package.Daniele Varrazzo2010-12-211-9/+4
|/ | | | | | 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.
* Deal uniformly with test servers without pg_sleep.Daniele Varrazzo2010-11-281-10/+8
|
* Don't consider the kernel not blocking us on write as an error.Daniele Varrazzo2010-11-251-1/+6
|
* Test cleanup.Daniele Varrazzo2010-11-191-11/+22
| | | | | | Tests pass or fail gracefully on older PostgreSQL versions. If unittest2 is available, skip tests instead of printing warnings.
* Making sync and async connection setup somewhat more consistent.Daniele Varrazzo2010-04-231-0/+5
|
* Dropped redundant call to conn_notice_process().Daniele Varrazzo2010-04-211-0/+9
| | | | | | | | | | | If the connection is sync, notices will be processed by pq_fetch() downstream. If the connection is async, here we have only sent the query: no result is ready yet, and neither notices have had a chance to arrive: they will be retrieved later by pq_is_busy(). Added tests to check the above statement don't break.
* Connection method 'executing()' renamed to 'isexecuting()'.Daniele Varrazzo2010-04-211-12/+12
|
* Connection method 'issync()' changed into the attribute 'async'.Daniele Varrazzo2010-04-211-3/+3
|
* Remove fileno() and poll() from cursorsJan Urbański2010-04-211-12/+30
| | | | | | | | Instead, the code should be using the fileno() and poll() methods of the cursor's connection. Handle the case when poll() is called on an already built connection as a request to poll the asynchronous query (if there is one) and get NOTIFY events. Update the tests to reflect that change, add a test for NOTIFY.
* Add one more test for errors involving two cursorsJan Urbański2010-04-201-0/+9
|
* Handle errors in asynchronous queries.Jan Urbański2010-04-201-0/+23
| | | | | | | | Do it by keeping the reference to the last PGresult in the cursor and calling pq_fetch() before ending the asynchronous execution. This takes care of handling the possible error state of the PGresult and also allows the removal of the needsfetch flag, since now after execution ends the results are already fetched and parsed.