Commit Graph

26 Commits

Author SHA1 Message Date
Khairi Hafsham 772374735d Make all tests to be PEP8 compliant
tested using pycodestyle version 2.2.0

Fixes: #3885
Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
2017-02-07 11:21:56 -05:00
Mike Bayer 428dfeee48 Repair PG BIGSERIAL w/ TypeDecorator, Variant
Some of the dialect impl memoization for TypeDecorator
necessarily keeps the top-level TypeDecorator type
around, since a user-defined type will have bind and result
set processing behavior.  For both TypeDecorator and Variant,
PG dialect needs to ensure it's looking at the SQLAlchemy
type to check for SmallInteger / BigInteger.

Fixes: 3739
Change-Id: I2d45fb997f17c6272d6bb826a77d2dba665adae7
(cherry picked from commit 421fa6b8bf)
2016-07-04 16:54:01 -04:00
Mike Bayer c59bf0007f - The `sqlalchemy.dialects.postgres` module, long deprecated, is
removed; this has emitted a warning for many years and projects
should be calling upon ``sqlalchemy.dialects.postgresql``.
Engine URLs of the form ``postgres://`` will still continue to function,
however.
2016-01-29 11:44:58 -05:00
Mike Bayer 4e6ec9eef4 - Repaired some typing and test issues related to the pypy
psycopg2cffi dialect, in particular that the current 2.7.0 version
does not have native support for the JSONB type.  The version detection
for psycopg2 features has been tuned into a specific sub-version
for psycopg2cffi.  Additionally, test coverage has been enabled
for the full series of psycopg2 features under psycopg2cffi.
fixes #3439
2015-06-05 17:34:02 -04:00
Mike Bayer a50dcb31b9 - Fixed bug where known boolean values used by
:func:`.engine_from_config` were not being parsed correctly;
these included ``pool_threadlocal`` and the psycopg2 argument
``use_native_unicode``. fixes #3435
- add legacy_schema_aliasing config parsing for mssql
- move use_native_unicode config arg to the psycopg2 dialect
2015-05-26 10:56:23 -04:00
Mike Bayer d140983148 Merge remote-tracking branch 'origin/pr/132' into pr132 2015-03-02 19:00:19 -05:00
Tony Locke 8038cfa077 pg8000 client_encoding in create_engine()
The pg8000 dialect now supports the setting of the PostgreSQL parameter
client_encoding from create_engine().
2014-12-16 20:55:55 +00:00
Mike Bayer 83326bf44c - The exception wrapping system for DBAPI errors can now accommodate
non-standard DBAPI exceptions, such as the psycopg2
TransactionRollbackError.  These exceptions will now be raised
using the closest available subclass in ``sqlalchemy.exc``, in the
case of TransactionRollbackError, ``sqlalchemy.exc.OperationalError``.
fixes #3075
2014-07-29 14:06:43 -04:00
Mike Bayer 54592942c4 - add support for tags, including include/exclude support.
simplify tox again now that we can exclude tests more easily
2014-07-27 18:46:20 -04:00
Mike Bayer 31178db914 - flake8 all of test/dialect/postgresql
- add __backend__ to most tests so that pg8000 can start coming in
2014-07-25 16:04:35 -04:00
Tony Locke f8f29d0a10 PEP 8 tidy of pg8000 dialect and postgresql/test_dialect.py 2014-05-22 20:36:27 +01:00
Tony Locke 66e0a7771f Autocommit isolation level for postgresql+pg8000
As with postgresql+psycopg2,
execution_options(isolation_level='AUTOCOMMIT') now works for the
postgresql+pg8000 dialect.

Also enabled the autocommit test in test_dialect.py for pg8000.
2014-05-22 20:13:10 +01:00
Tony Locke fc4e113cf1 pg8000 now passes test_extract() test 2014-05-21 19:17:41 +01:00
Alex Gaynor 1caa7fafbd Fix many typos throughout the codebase
Found using: https://github.com/intgr/topy
2014-04-26 13:13:13 -07:00
Shaun Stanworth 0953f26250 78-char width 2015-01-26 18:43:19 -05:00
Shaun Stanworth f94d75ede5 Added psycopg2cffi dialect 2015-01-26 18:43:19 -05:00
Mike Bayer ecdfc31774 - Support has been improved for Postgresql reflection behavior on very old
(pre 8.1) versions of Postgresql, and potentially other PG engines
such as Redshift (assuming Redshift reports the version as < 8.1).
The query for "indexes" as well as "primary keys" relies upon inspecting
a so-called "int2vector" datatype, which refuses to coerce to an array
prior to 8.1 causing failures regarding the "ANY()" operator used
in the query.  Extensive googling has located the very hacky, but
recommended-by-PG-core-developer query to use when PG version < 8.1
is in use, so index and primary key constraint reflection now work
on these versions.
2014-02-18 18:35:23 -05:00
Mike Bayer d98fcca0b3 this test appears to be failing with pg 9.3, not sure how to restore it 2013-12-17 15:37:50 -05:00
Mike Bayer 46ac022e57 - move this test to PG test_reflection
- don't use locals()
2013-10-25 17:19:03 -04:00
Mike Bayer e5a42a748b Merge branch 'master' of github.com:ijl/sqlalchemy into merge_2183 2013-10-25 17:01:38 -04:00
Mike Bayer a5dc173ea6 - Added support for rendering `SMALLSERIAL when a :class:.SmallInteger`
type is used on a primary key autoincrement column, based on server
version detection of Postgresql version 9.2 or greater.
[ticket:2840]
2013-10-15 19:06:21 -04:00
ijl 9d952e0a11 PostgreSQL foreign key inspection includes options 2013-10-11 15:01:14 -04:00
Mike Bayer 94d421ca2f - put exact version string in the test
- use match with a .* preceding instead of search
2013-09-29 17:24:29 -04:00
Mike Bayer 62463b95e0 add test for upcoming pullreq 2013-09-29 17:19:25 -04:00
Mike Bayer b38a76cd1d - replace most explicitly-named test objects called "Mock..." with
actual mock objects from the mock library.  I'd like to use mock
for new tests so we might as well use it in obvious places.
- use unittest.mock in py3.3
- changelog
- add a note to README.unittests
- add tests_require in setup.py
- have tests import from sqlalchemy.testing.mock
- apply usage of mock to one of the event tests.  we can be using
this approach all over the place.
2013-06-30 18:35:12 -04:00
Mike Bayer 1c23741b8e refactor test suites for postgresql, mssql, mysql into packages. 2013-06-28 22:30:11 -04:00