diff options
-rw-r--r-- | lib/sqlalchemy/test/testing.py | 2 | ||||
-rw-r--r-- | test/sql/test_types.py | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/sqlalchemy/test/testing.py b/lib/sqlalchemy/test/testing.py index 31a271a03..771b8c90f 100644 --- a/lib/sqlalchemy/test/testing.py +++ b/lib/sqlalchemy/test/testing.py @@ -33,7 +33,7 @@ db = None # more sugar, installed by __init__ requires = None -def fails_if(callable_): +def fails_if(callable_, reason=None): """Mark a test as expected to fail if callable_ returns True. If the callable returns false, the test is run and reported as normal. diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 532a89d1d..2a17c7218 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -421,7 +421,11 @@ class UnicodeTest(TestBase, AssertsExecutionResults): # end Py2K eq_(uni(unicodedata), unicodedata.encode('utf-8')) - + + @testing.fails_if( + lambda: testing.db_spec("postgresql+pg8000")(testing.db) and util.py3k, + "pg8000 appropriately does not accept 'bytes' for a VARCHAR column." + ) def test_ignoring_unicode_error(self): """checks String(unicode_error='ignore') is passed to underlying codec.""" @@ -488,7 +492,9 @@ class UnicodeTest(TestBase, AssertsExecutionResults): result.close() x = ascii_row['plain_varchar_no_coding_error'] - a = hexlify(x) + # on python3 "x" comes back as string (i.e. unicode), + # hexlify requires bytes + a = hexlify(x.encode('utf-8')) b = hexlify(asciidata) eq_(a, b) |