summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Remove unused imports from tests/test_ipaddress.pyJon Dufresne2019-03-131-3/+0
|
* Added ConnectionInfo.dsn_parameters attributeinfo-dsn-paramsDaniele Varrazzo2019-02-171-0/+7
|
* Copyright year updatedDaniele Varrazzo2019-02-1728-28/+28
| | | | | ag -l Copyright | xargs sed -i \ "s/\(.*copyright (C) [0-9]\+\)\(-[0-9]\+\)\?\(.*\)/\1-$(date +%Y)\3/I"
* Merge branch 'libpq-ptrs'Daniele Varrazzo2019-02-173-0/+50
|\
| * Skip tests involving ctypes on WindowsDaniele Varrazzo2019-02-161-0/+3
| | | | | | | | No idea about how to import libpq.
| * Added connection.pgconn_ptr and cursor.pgresult_ptrDaniele Varrazzo2019-02-163-0/+47
| | | | | | | | | | | | Allow interacting with libpq in Python via ctypes. See #782.
* | Skip password encryption test if libpq < 10Daniele Varrazzo2019-02-161-0/+1
|/
* Fixed use of StandardError in testDaniele Varrazzo2019-02-111-1/+1
| | | | In Py3 it's gone.
* SQLSTATE error classes implemented in CDaniele Varrazzo2019-02-101-3/+22
| | | | The module is only used to export them to Python.
* Use a proper LRU cache for namedtuplesfast-namedtupleDaniele Varrazzo2019-02-021-13/+16
| | | | | | | | | Previous one didn't refresh by last use. Use the stdlib version for py3 and one of our own for py2. Max size set to 512, which should be fine for everyone (tweaking is still possible by monkeypatching, as the tests do, but I don't want to make an interface of it).
* Added caching of types generated by NamedTupleCursorDaniele Varrazzo2019-02-021-0/+36
| | | | see #838
* Added BYTESARRAY typecasterDaniele Varrazzo2019-01-181-0/+26
|
* Added test for BYTES typecasterDaniele Varrazzo2019-01-181-0/+11
|
* Merge remote-tracking branch ↵Daniele Varrazzo2018-12-271-0/+9
|\ | | | | | | 'eternalflow/execute-values-returning-clause-support'
| * rename param name to fetchIvan Kotelnikov2018-11-241-1/+1
| |
| * write test for fetch_result flagIvan Kotelnikov2018-11-221-0/+9
| |
* | Remove unnecessary test decorator 'skip_if_cant_cast'Jon Dufresne2018-12-041-27/+8
| | | | | | | | | | | | ctypes is available and works on all supported Pythons. It has been available since Python 2.5. The tests were written when Python 2.4 was still supported.
* | Merge pull request #822 from jdufresne/decorate-allDaniele Varrazzo2018-12-042-88/+50
|\ \ | | | | | | Simplify 'decorate_all_tests' usage by decorating the test class
| * | Simplify 'decorate_all_tests' usage by decorating the test classJon Dufresne2018-12-012-88/+50
| |/ | | | | | | | | Skip tests as early as possible by decorating the whole class with unittest.skipIf instead of every test method individually.
* | Remove workarounds for unsupported libpq < 9.1Jon Dufresne2018-12-011-2/+0
|/ | | | | | Per http://initd.org/psycopg/docs/install.html#prerequisites: > PostgreSQL client library version from 9.1
* Convert int subclasses to long before adaptingDaniele Varrazzo2018-11-161-0/+12
| | | | | | | | | | | | Fixes adaptation of int/long subclasses whose str() is not the number, such IntEnum Close #591 Note that I thought it would have needed a new adapter, so I considered it a new feature. But it is more a shortcoming of the int adapter failing to do something reasonable (poor Liskov, always mistreated) so I may actually backport it if there is a new 2.7 release.
* Merge branch 'master' into feature-expose-pgconnFederico Di Gregorio2018-11-0726-172/+572
|\
| * Fixed adaptation of lists of empty listsfix-788Daniele Varrazzo2018-10-301-3/+6
| | | | | | | | | | | | | | | | ...somehow. Postgres doesn't support them and converts them into a simple empty array. However this is not really our concern: the syntax we return is valid. Close #788
| * Use class decorators to decorate all testsdecorators-funDaniele Varrazzo2018-10-309-87/+81
| | | | | | | | | | | | Test decorators changed so that they can be applied either to a method or to a class. Of course their double nature is implemented by a decorator.
| * Don't barf on Composite passed to execute_values()fix-794Daniele Varrazzo2018-10-231-0/+20
| | | | | | | | Close #794
| * Full flake8 3.5 cleanupDaniele Varrazzo2018-10-2324-25/+68
| |
| * Merge branch 'connection-info'Daniele Varrazzo2018-10-158-70/+209
| |\
| | * Use the connection.info properties instead of the legacy methodsconnection-infoDaniele Varrazzo2018-10-138-65/+65
| | |
| | * Guard from some info functions not available in some libpq versionsDaniele Varrazzo2018-10-131-0/+11
| | |
| | * Added ConnectionInfo.parameter_status()Daniele Varrazzo2018-10-131-0/+15
| | |
| | * Added ConnectionInfo.ssl_attribute()Daniele Varrazzo2018-10-131-0/+15
| | |
| | * Added all the missing ConnectionInfo attributesDaniele Varrazzo2018-10-131-0/+28
| | |