Jon Dufresne
390e43fcb1
Use modern except syntax throughout project
...
The syntax "except Exception, exc:" is deprecated. All Python versions
supported by psycopg2 support the newer, modern syntax. Forward
compatible with future Python versions.
2017-11-20 20:00:35 -08:00
Daniele Varrazzo
de8b335d80
Merge branch 'master' into sql-compose
2017-02-03 04:56:02 +00:00
Daniele Varrazzo
1911b250e3
Merge branch 'async-keyword'
...
Close #495
2017-02-03 04:45:17 +00:00
Daniele Varrazzo
ce9be69615
Added async_ as an alias for async
...
Added in argument for psycopg2.connect() and connection.__init__, and
for the connection.async attribute.
2017-02-03 04:43:49 +00:00
Daniele Varrazzo
8baf6aa372
Convert warnings into errors on test
2017-02-03 04:41:32 +00:00
Daniele Varrazzo
dc1b4fff90
Avoid an useless encode/decode roundtrip in execute_values()
...
Tests moved into a separate module.
2017-02-02 17:29:17 +00:00
Daniele Varrazzo
fad5100079
Adding some boilerplate for the new module
2017-01-01 03:53:08 +01:00
Daniele Varrazzo
643ba70bad
Added ipaddress objects conversion
...
Close #387
2016-10-11 04:54:41 +01:00
Daniele Varrazzo
91d2158de7
Python source cleanup using flake8
2016-10-11 00:11:55 +01:00
Oleksandr Shulgin
cb7032554e
Merge branch 'master' into feature/replication-protocol-c-connection-object
2016-03-04 10:52:10 +01:00
Daniele Varrazzo
5fd0f6c4ee
Fixed race condition on import in errorcodes.lookup
...
Fixes #382 .
2015-12-16 12:03:10 +00:00
Oleksandr Shulgin
22cbfb26d6
Actually add replication tests to the test suite.
2015-10-20 13:05:43 +02:00
Daniele Varrazzo
cc605032f5
Added support for with statement for connection and cursor
...
The implementation should be conform to the DBAPI, although the "with"
extension has not been released yet.
2012-12-03 02:50:24 +00:00
Daniele Varrazzo
0fccc10777
Tests in order
...
Just to know where to put the next one
2011-11-18 00:10:53 +00:00
Daniele Varrazzo
99ac79511c
Added test module to verify the dsn manipulation
2011-11-17 21:51:24 +00:00
Daniele Varrazzo
d79661c87f
All unit test modules have a test_ prefix
...
Both for consistency and for test discovery.
2011-10-19 02:20:43 +01:00
Daniele Varrazzo
bf48706868
Don't check the test db exists at psycopg2.tests import time
2011-03-30 15:52:49 +01:00
Daniele Varrazzo
79048ff19a
Merge branch 'python2' into python3
...
Conflicts:
NEWS-2.3
tests/__init__.py
tests/test_lobject.py
tests/test_quote.py
tests/testutils.py
2011-01-10 00:46:02 +00:00
Daniele Varrazzo
15a09da96d
Added license to unit tests
...
As the test suite is now part of the source distribution.
2011-01-09 23:44:35 +00:00
Daniele Varrazzo
a01700d478
Fixed test suite execution as a script
...
Don't know why I changed the defaultTest argument into a function when I
converted the test suite into a package: that argument should be really
a string.
2011-01-03 20:45:03 +01:00
Daniele Varrazzo
929d62053a
Merge branch 'python2' into python3
...
Conflicts:
NEWS-2.3
setup.py
2011-01-02 03:28:00 +01:00
Daniele Varrazzo
3cc8719998
Added missing test to the test suite.
2011-01-02 03:00:44 +01:00
Daniele Varrazzo
ade1b2cc7b
Test suite converted into a proper package.
...
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.
2010-12-21 05:02:19 +00:00
Daniele Varrazzo
46a5f140c7
Bail out early from tests if connection to the test db fails.
2010-12-01 20:56:25 +00:00
Jan Urbański
751bfa1ea6
Support query cancellation.
...
Add a cancel() method do the connection object that will interrupt
the current query using the libpq PQcancel() function.
2010-11-28 11:50:02 +00:00
Daniele Varrazzo
19ead4a5cb
Test cleanup.
...
Tests pass or fail gracefully on older PostgreSQL versions.
If unittest2 is available, skip tests instead of printing warnings.
2010-11-19 03:55:37 +00:00
Daniele Varrazzo
bd6a4139da
Added test to verify executemany doesn't propagate exceptions.
2010-07-09 15:23:02 +01:00
Daniele Varrazzo
b597ccf917
Tests can be run again different coroutine libraries.
...
Use PSYCOPG2_TEST_GREEN=<something>, where <something> is 1 or a library
name. Currently eventlet is supported.
2010-05-19 11:40:13 +01:00
Daniele Varrazzo
e29424a230
Dropped large object support when psycopg is in green mode.
...
Async mode and large object are not compatible, albeit I haven't found
an authoritative source yet.
2010-05-09 20:34:02 +01:00
Daniele Varrazzo
8fed0aa57d
Forbid COPY-related methods in green mode.
...
With the current implementation, at best they would silently block. They
actually hang everything.
Implementation posponed after some refactoring of the polling system,
because it will be probably possible to provide an implementation for
'poll()' during COPY which is good for both async and green modes.
2010-04-21 15:21:33 +01:00
Daniele Varrazzo
0dd5d3f1d9
Correctly flush async queries in 'green' mode.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
1108172e4c
The test suite can be run against the green path.
2010-04-21 15:21:32 +01:00
Daniele Varrazzo
02a28ff028
Notifications are automatically read after each query.
...
Added tests for basic notifications process.
2010-04-21 15:09:14 +01:00
Daniele Varrazzo
b114e25c31
Added some COPY tests.
2010-04-07 23:41:32 +01:00
Jan Urbański
eb646f71fa
Add tests for the asynchronous API
2010-04-05 11:32:03 +02:00
Federico Di Gregorio
611606d532
Changes license to LGPL3 + OpenSSL exception on all source files
2010-02-12 23:34:53 +01:00
Federico Di Gregorio
5b04203c9f
Fixed error in register_type()
2009-03-02 10:59:52 +01:00
James Henstridge
9a48c261be
Add basic tests for large object code. Fix lobject.seek() to actually
...
work.
2008-05-05 15:33:44 +08:00
James Henstridge
2f3f4c1258
2008-04-21 Jorgen Austvik <Jorgen.Austvik@sun.com>
...
* tests/*.py: use the DSN constructed in tests/__init__.py.
* tests/__init__.py: allow setting the host, port and user for the
DSN used by the tests through the environment.
2008-04-20 23:12:21 +00:00
James Henstridge
3265dd172d
* tests/test_connection.py (ConnectionTests): add simple tests for
...
the Connection and Cursor "closed" attributes.
* psycopg/cursor_type.c (psyco_curs_get_closed): add a "closed"
attribute to cursors. It will be True if either the cursor or its
associated connection are closed. This fixes bug #164 .
2008-01-19 03:32:42 +00:00
James Henstridge
46bf23caf4
* tests/__init__.py (test_suite): add date tests to test suite.
...
* tests/test_dates.py: add tests for date/time typecasting and
adaption.
* psycopg/adapter_mxdatetime.c (mxdatetime_str): add support for
outputting BC dates (which involves switching them to one-based
dates). Also remove broken handling of microseconds.
* psycopg/typecast.c (typecast_parse_date): if the string ends
with "BC" adjust the year value to be a zero-based BC value as
used by mx.DateTime (datetime doesn't support BC dates).
(typecast_parse_time): ignore ' ', 'B' and 'C' in time strings
rather than treating them as part of the seconds part of the time.
2008-01-16 01:43:50 +00:00
Daniele Varrazzo
67afd678b0
Added 'make check' target, running all the available tests.
...
Most of the updates have been provided by James Henstridge.
Closes ticket #195 .
2007-11-11 10:40:12 +00:00
Federico Di Gregorio
c9e701baa9
Fixed bug #194 (and added nice MD project not that C/C++ is supported.)
2007-09-08 08:54:30 +00:00