From 93551a151eaae4a33758188bee88ef139fdeff2b Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 20 Jul 2008 21:14:00 +0200 Subject: [PATCH] Py3 test fixes --- tests/run/flatin.pyx | 8 ++++---- tests/run/withstat.pyx | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) 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))): -- 2.26.2