diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-23 21:38:39 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-02-23 21:38:39 +0000 |
commit | 189414fe2999d281ad8b45b89f97a3c56fc5e84b (patch) | |
tree | 39feda2e81d8d40a493b0842927949cac91b8866 | |
parent | 0f4770775fd91f43a7243965eb15b090d4c34a88 (diff) | |
download | sqlalchemy-189414fe2999d281ad8b45b89f97a3c56fc5e84b.tar.gz |
add some py3k caveats
-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) |