summaryrefslogtreecommitdiff
path: root/tests/test_cancel.py
Commit message (Collapse)AuthorAgeFilesLines
* 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-2/+2
| | | | | | The syntax "except Exception, exc:" is deprecated. All Python versions supported by psycopg2 support the newer, modern syntax. Forward compatible with future Python versions.
* Work around a race condition in async cancel testDaniele Varrazzo2017-02-061-1/+4
|
* 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.
* Merge branch 'async-keyword'Daniele Varrazzo2017-02-031-2/+2
|\ | | | | | | Close #495
| * Added async_ as an alias for asyncDaniele Varrazzo2017-02-031-2/+2
| | | | | | | | | | Added in argument for psycopg2.connect() and connection.__init__, and for the connection.async attribute.
* | 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-0/+2
|
* Testing boilerplate unified in a single base classDaniele Varrazzo2013-04-071-7/+4
| | | | | The class makes a connection always available, allows creating new connection and closes everything on tear down.
* Cleanup of skipping of testing methods on certain Py/PG versionsDaniele Varrazzo2011-02-151-3/+3
|
* Merge branch 'python2' into python3Daniele Varrazzo2011-01-101-0/+23
|\ | | | | | | | | | | | | | | | | 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/+23
| | | | | | | | As the test suite is now part of the source distribution.
| * All tests made executable.Daniele Varrazzo2011-01-071-0/+0
| |
* | Merge branch 'python2' into python3Daniele Varrazzo2011-01-011-1/+1
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: ChangeLog NEWS-2.3 lib/extensions.py psycopg/microprotocols.c setup.py
| * Shorter "never ending query" to test query canceling.Daniele Varrazzo2010-12-041-1/+1
| | | | | | | | | | If the cancel signal misses the race, this query will stay in the backend until the sleep expires.
* | Test suite converted into a proper package.Daniele Varrazzo2010-12-211-5/+5
|/ | | | | | 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-1/+3
|
* Support query cancellation.Jan UrbaƄski2010-11-281-0/+89
Add a cancel() method do the connection object that will interrupt the current query using the libpq PQcancel() function.