summaryrefslogtreecommitdiff
path: root/tests/test_module.py
Commit message (Collapse)AuthorAgeFilesLines
* Avoid installing tests to site-packagesJon Dufresne2017-12-101-2/+1
| | | | | | | | 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-1/+1
| | | | | | | | | | | | | | 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/
* Merge remote-tracking branch 'jdufresne/import-unittest'Daniele Varrazzo2017-12-021-1/+2
|\
| * 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.
* | Remove unnecessary script_to_py3; make scripts compatible insteadJon Dufresne2017-12-011-2/+2
|/ | | | Part of the work towards moving tests out of the installed package.
* Remove use of skip_before_python for unsupported Python versionsJon Dufresne2017-11-261-3/+1
| | | | | psycopg2 does not support Python < 2.6, remove all test guards for these versions.
* Use modern except syntax throughout projectJon Dufresne2017-11-201-11/+11
| | | | | | The syntax "except Exception, exc:" is deprecated. All Python versions supported by psycopg2 support the newer, modern syntax. Forward compatible with future Python versions.
* assertDsnEqual moved as TestSuite methodDaniele Varrazzo2017-02-061-7/+7
|
* Merge branch 'async-keyword'Daniele Varrazzo2017-02-031-18/+15
|\ | | | | | | Close #495
| * Added async_ as an alias for asyncDaniele Varrazzo2017-02-031-19/+16
| | | | | | | | | | Added in argument for psycopg2.connect() and connection.__init__, and for the connection.async attribute.
* | Further skipping of slow testsDaniele Varrazzo2017-02-021-2/+3
|/
* Fixed tests failing on Python 2.6Daniele Varrazzo2016-12-241-2/+2
|
* Use python-defined make_dsn() for ReplicationConnection classOleksandr Shulgin2016-03-081-1/+1
|
* Merge branch 'master' into feature/replication-protocol-c-connection-objectOleksandr Shulgin2016-03-041-34/+29
|\
| * Validate output result from make_dsn()Daniele Varrazzo2016-03-031-22/+12
| | | | | | | | | | The output is not necessarily munged anyway: if no keyword is passed, validate the input but return it untouched.
| * Verify that the dsn is not manipulated by make_dsn if not necessaryDaniele Varrazzo2016-03-031-12/+25
| |
| * Implementation of make_dsn in PythonDaniele Varrazzo2016-03-031-18/+20
| | | | | | | | | | This is equivalent to what proposed in #363, but with a much simpler implementation.
* | Rework psycopg2.connect() interface.Oleksandr Shulgin2015-10-271-8/+24
|/
* Add test for libpq_versionOleksandr Shulgin2015-06-021-0/+9
|
* Added test to verify _psycopg can be importedDaniele Varrazzo2014-08-281-1/+26
|
* Fixed pickling of exceptions with no pgerror/pgcode setDaniele Varrazzo2013-07-191-0/+15
| | | | Fixes ticket #170.
* Skip tests on python implementations without getrefcount()Daniele Varrazzo2013-05-061-1/+1
| | | | PyPy is one of these.
* Testing boilerplate unified in a single base classDaniele Varrazzo2013-04-071-10/+2
| | | | | The class makes a connection always available, allows creating new connection and closes everything on tear down.
* Merge branch 'diagnostics' into develDaniele Varrazzo2013-03-201-0/+32
|\
| * Added tests to verify the new Diagnostics propertiesDaniele Varrazzo2013-03-201-0/+32
| | | | | | | | | | | | | | diag can be used on exceptions raised without cursor and is independent from the cursor. Docs updated to reflect the changes.
* | Tests tweaked to run on all the supported versionsDaniele Varrazzo2013-03-181-1/+2
|/
* Added test to verify Diagnostics works after copy errorsDaniele Varrazzo2013-03-181-0/+11
|
* Added test to verify Diagnostics reference disposalDaniele Varrazzo2013-03-181-0/+25
|
* Added all supported properties to the Diagnostic objectDaniele Varrazzo2013-03-171-1/+31
|
* Work-in-progress support for retrieving PG_DIAG result error fields.Matthew Woodcraft2013-03-171-1/+20
|
* Raise TypeError instead of InterfaceError on bad params on connect()Daniele Varrazzo2012-09-261-6/+6
| | | | | | | | | | | | | | TypeError is the standard Python error raised in this case: $ python -c "(lambda a: None)(b=10)" TypeError: <lambda>() got an unexpected keyword argument 'b' We only used to raise InterfaceError when connect was used without any parameter at all, so it's hard to think a program depending on that design. Furthermore the function has always raised (and still does) OperationalError too, if the bad argument is detected by the libpq, and that cannot be changed because we can't tell the difference from a normal connection error.
* Dropped quirks in connection arguments handlingDaniele Varrazzo2012-09-251-0/+8
| | | | | | | Now connect() raises an exception instead of swallowing keyword arguments when a connection string is specified as well Closes ticket #131.
* Fixed exception testing on Python 3Daniele Varrazzo2012-02-231-4/+6
| | | | | ...and so caught exceptions are local to the except suite in Py3. (Lo sapevate? Sapevatelo!)
* Make Error and subclasses picklableDaniele Varrazzo2012-01-141-1/+34
| | | | | Useful for multiprocessing interaction. Closes ticket #90.
* Added test to check connect() with no parametersDaniele Varrazzo2011-11-171-0/+7
|
* Escape parameters to the connection strings as required by PQconnectdbDaniele Varrazzo2011-11-171-0/+20
|
* Added test module to verify the dsn manipulationDaniele Varrazzo2011-11-171-0/+107