From: Stefan Behnel Date: Sun, 20 Jul 2008 19:14:00 +0000 (+0200) Subject: Py3 test fixes X-Git-Tag: 0.9.8.1~114 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93551a151eaae4a33758188bee88ef139fdeff2b;p=cython.git Py3 test fixes --- diff --git a/tests/run/flatin.pyx b/tests/run/flatin.pyx index 58ca047e..471f300f 100644 --- a/tests/run/flatin.pyx +++ b/tests/run/flatin.pyx @@ -23,9 +23,9 @@ __doc__ = u""" """ def test_in(s): - if s in ('ABC', 'BCD'): + if s in (u'ABC', u'BCD'): return 1 - elif s.upper() in ('ABC', 'BCD'): + elif s.upper() in (u'ABC', u'BCD'): return 2 elif len(s) in (1,2): return 3 @@ -35,9 +35,9 @@ def test_in(s): return 5 def test_not_in(s): - if s not in ('ABC', 'BCD', 'CDE', 'CDEF'): + if s not in (u'ABC', u'BCD', u'CDE', u'CDEF'): return 1 - elif s.upper() not in ('ABC', 'BCD', 'CDEF'): + elif s.upper() not in (u'ABC', u'BCD', u'CDEF'): return 2 elif len(s) not in [3]: return 3 diff --git a/tests/run/withstat.pyx b/tests/run/withstat.pyx index f44b0c28..4d08c9f2 100644 --- a/tests/run/withstat.pyx +++ b/tests/run/withstat.pyx @@ -49,20 +49,20 @@ class ContextManager: return self.value def no_as(): - with ContextManager("value"): - print "hello" + with ContextManager(u"value"): + print u"hello" def basic(): - with ContextManager("value") as x: + with ContextManager(u"value") as x: print x def with_exception(exit_ret): try: - with ContextManager("value", exit_ret=exit_ret) as value: + with ContextManager(u"value", exit_ret=exit_ret) as value: print value raise MyException() except: - print "outer except" + print u"outer except" def multitarget(): with ContextManager((1, 2, (3, (4, 5)))) as (a, b, (c, (d, e))):