diff options
| author | Christoph Zwerschke <cito@online.de> | 2016-02-09 15:20:51 +0100 |
|---|---|---|
| committer | Christoph Zwerschke <cito@online.de> | 2016-02-09 15:20:51 +0100 |
| commit | 29ef0ad7c12d9ac8c27123d945bc4fbd74ba1a3c (patch) | |
| tree | cfc1801574f81439fe27da7de3a7e7fffbb99c33 /test | |
| parent | c65a805f577d659a2cb169a447b0134c081d500a (diff) | |
| download | sqlalchemy-pr/234.tar.gz | |
Make all tests pass with postgresql+pygresqlpr/234
Note that it requires the latest PyGreSQL 5.0
to pass all tests, a warning is printed otherwise.
Minor change to test.dialect.postgresql.test_types:
- JSON content should not be required to be unicode
if the dialect doesn't return unicode (Python 2).
Minor change to dialects/postgresql.base:
- Return index names properly casted to unicode
Diffstat (limited to 'test')
| -rw-r--r-- | test/dialect/postgresql/test_types.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py index 8818a9941..6bcc4cf9a 100644 --- a/test/dialect/postgresql/test_types.py +++ b/test/dialect/postgresql/test_types.py @@ -544,11 +544,11 @@ class NumericInterpretationTest(fixtures.TestBase): __backend__ = True def test_numeric_codes(self): - from sqlalchemy.dialects.postgresql import psycopg2cffi, pg8000, \ - psycopg2, base + from sqlalchemy.dialects.postgresql import pg8000, pygresql, \ + psycopg2, psycopg2cffi, base - dialects = (pg8000.dialect(), psycopg2.dialect(), - psycopg2cffi.dialect()) + dialects = (pg8000.dialect(), pygresql.dialect(), + psycopg2.dialect(), psycopg2cffi.dialect()) for dialect in dialects: typ = Numeric().dialect_impl(dialect) for code in base._INT_TYPES + base._FLOAT_TYPES + \ @@ -2757,7 +2757,10 @@ class JSONRoundTripTest(fixtures.TablesTest): result = engine.execute( select([data_table.c.data['k1'].astext]) ).first() - assert isinstance(result[0], util.text_type) + if engine.dialect.returns_unicode_strings: + assert isinstance(result[0], util.text_type) + else: + assert isinstance(result[0], util.string_types) def test_query_returned_as_int(self): engine = testing.db |
