# 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.
# 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."""
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)