summaryrefslogtreecommitdiff
path: root/tests/testutils.py
Commit message (Collapse)AuthorAgeFilesLines
* Added decorator to clean up the adaptation mappings after testsfix-948Daniele Varrazzo2019-09-041-0/+17
| | | | | | | Many tests were doing it manually, some weren't doing it and resulted in failure if run in different order. Close #948
* 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-161-3/+3
|
* Use errors module to catch a specific postgres errorDaniele Varrazzo2019-03-161-6/+3
|
* Other import moved to top level in testsDaniele Varrazzo2019-03-161-10/+7
|
* TextIOBase moved to tests compat importsDaniele Varrazzo2019-03-161-0/+3
|
* Move imports to the top of the module across testsJon Dufresne2019-03-161-3/+3
| | | | | | | | | | 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.
* 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"
* 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-161-0/+14
| | | | | | Allow interacting with libpq in Python via ctypes. See #782.
* Simplify 'decorate_all_tests' usage by decorating the test classJon Dufresne2018-12-011-73/+44
| | | | | Skip tests as early as possible by decorating the whole class with unittest.skipIf instead of every test method individually.
* Use class decorators to decorate all testsdecorators-funDaniele Varrazzo2018-10-301-5/+37
| | | | | | 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.
* Full flake8 3.5 cleanupDaniele Varrazzo2018-10-231-2/+4
|
* Use the connection.info properties instead of the legacy methodsconnection-infoDaniele Varrazzo2018-10-131-4/+4
|
* Prefer https:// URLs when availableJon Dufresne2018-09-221-1/+1
|
* In tests, use compat.py where there is overlapJon Dufresne2017-12-111-3/+2
|
* Avoid installing tests to site-packagesJon Dufresne2017-12-101-0/+17
| | | | | | | | 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/
* Remove unnecessary script_to_py3; make scripts compatible insteadJon Dufresne2017-12-011-28/+0
| | | | Part of the work towards moving tests out of the installed package.
* Dropped unused test functionsDaniele Varrazzo2017-11-281-3/+0
|
* Remove redundant hasattr checksHugo2017-11-281-31/+2
|
* Merge remote-tracking branch 'jdufresne/uuid'Daniele Varrazzo2017-11-281-5/+0
|\
| * Remove uuid workaround for older PythonsJon Dufresne2017-11-261-5/+0
| | | | | | | | uuid is available on all Python versions supported by psycopg2.
* | Merge remote-tracking branch 'jdufresne/iobase'Daniele Varrazzo2017-11-281-14/+0
|\ \
| * | Remove io.TextIOBase workaround for Python <= 2.5Jon Dufresne2017-11-261-14/+0
| |/ | | | | | | | | io.TextIOBase is available on all Python versions supported by psycopg2. Can remove all workarounds.
* | Remove workarounds for namedtuple on Python <= 2.5Jon Dufresne2017-11-261-13/+0
|/ | | | | | namedtuple is available on all Python versions supported by psycopg2. It was first introduced in Python 2.6. Can remove all workarounds and special documentation.
* Use modern except syntax throughout projectJon Dufresne2017-11-201-3/+3
| | | | | | The syntax "except Exception, exc:" is deprecated. All Python versions supported by psycopg2 support the newer, modern syntax. Forward compatible with future Python versions.
* Skip the tests according to the earliest of libpq built/linked.Daniele Varrazzo2017-03-021-1/+1
|
* Don't try to use unittest2no-unittest2Daniele Varrazzo2017-03-011-8/+1
| | | | | Modules importing unittest directly would miss the monkeypatch: see ticket #516.
* Deal consistently with E'' quotes in testsDaniele Varrazzo2017-02-061-1/+14
|
* assertDsnEqual moved as TestSuite methodDaniele Varrazzo2017-02-061-4/+7
|
* Merge branch 'async-keyword'Daniele Varrazzo2017-02-031-3/+11
|\ | | | | | | Close #495
| * Added async_ as an alias for asyncDaniele Varrazzo2017-02-031-1/+5
| | | | | | | | | | Added in argument for psycopg2.connect() and connection.__init__, and for the connection.async attribute.
| * Convert warnings into errors on testDaniele Varrazzo2017-02-031-2/+6
| |
* | Added note about finding slow testsDaniele Varrazzo2017-02-021-1/+6
| |
* | Allow skipping the slow testmanylinuxDaniele Varrazzo2017-02-021-1/+10
|/ | | | | | | | 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.
* Added test to verify bug #482Daniele Varrazzo2016-12-251-1/+10
|
* Fixed tests failing on Python 2.6Daniele Varrazzo2016-12-241-0/+3
|
* Python source cleanup using flake8Daniele Varrazzo2016-10-111-5/+20
|
* Merge branch 'master' into replication-protocolDaniele Varrazzo2016-08-071-1/+1
|\ | | | | | | | | Conflicts: tests/testconfig.py
| * Fix scattered grammar/spelling errors in comments, debug output, etc.Greg Ward2016-06-301-1/+1
| |
* | Move replication connection to C level.Oleksandr Shulgin2015-10-271-3/+0
| |
* | Fix async replication and test.Oleksandr Shulgin2015-10-151-1/+20
|/
* Report NotSupportedError for PGRES_COPY_BOTH and PGRES_SINGLE_TUPLEDaniele Varrazzo2015-09-301-3/+26
| | | | Fixes #352.
* Add libpq version discoveryOleksandr Shulgin2015-06-011-0/+37
|
* Fix several typosHyunjun Kim2015-05-031-1/+2
|
* Skip test_cleanup_on_badconn_close on WindowsJason Erickson2014-05-191-0/+12
| | | | | | | | | | | The Windows server version of PostgreSQL uses a function called pgkill in the file kill.c in place of the UNIX kill function. This pgkill function simulates some of the SIGHUP like commands by passing signals through a named pipe. Because it is passing the signal through a pipe, the server doesn't get the kill signal immediately and therefore fails the test on test_connection.ConnectionTests.test_cleanup_on_badconn_close. Ideally, the test should check to see if the server is running on Windows, not the psycopg.
* New implementation of Range sorting that works for Python 2.5 to 3.3, at least.Chris Withers2014-02-181-0/+10
|
* Skip tests on python implementations without getrefcount()Daniele Varrazzo2013-05-061-0/+9
| | | | PyPy is one of these.
* Testing boilerplate unified in a single base classDaniele Varrazzo2013-04-071-3/+50
| | | | | The class makes a connection always available, allows creating new connection and closes everything on tear down.