Fix syntax error in tests when run with Python 3.1 and 3.2.

This commit is contained in:
Valentin Lorentz 2013-08-10 15:40:10 +02:00
parent 0dc5160dbc
commit 744681d259

View File

@ -72,9 +72,13 @@ class TokenizerTestCase(SupyTestCase):
self.assertEqual(tokenize('foo "bar baz" quux'), self.assertEqual(tokenize('foo "bar baz" quux'),
['foo', 'bar baz', 'quux']) ['foo', 'bar baz', 'quux'])
def testUnicode(self): _testUnicode = """
def testUnicode(self):
self.assertEqual(tokenize(u''), [u'']) self.assertEqual(tokenize(u''), [u''])
self.assertEqual(tokenize(u'""'), [u'']) self.assertEqual(tokenize(u'""'), [u''])"""
if sys.version_info[0] >= 3:
_testUnicode = _testUnicode.replace("u'", "'")
exec(_testUnicode)
def testNesting(self): def testNesting(self):
self.assertEqual(tokenize('[]'), [[]]) self.assertEqual(tokenize('[]'), [[]])