mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-10 07:41:51 +08:00
fix python 2.7 issues. the parser now only takes unicode inputs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import jedi.parser as parser
|
||||
from jedi import parser
|
||||
from jedi._compatibility import u
|
||||
|
||||
try:
|
||||
import unittest2 as unittest
|
||||
@@ -8,18 +9,18 @@ except ImportError: # pragma: no cover
|
||||
|
||||
class TokenTest(unittest.TestCase):
|
||||
def test_end_pos_one_line(self):
|
||||
parsed = parser.Parser('''
|
||||
parsed = parser.Parser(u('''
|
||||
def testit():
|
||||
a = "huhu"
|
||||
''')
|
||||
'''))
|
||||
tok = parsed.module.subscopes[0].statements[0].token_list[2]
|
||||
self.assertEqual(tok.end_pos, (3, 14))
|
||||
|
||||
def test_end_pos_multi_line(self):
|
||||
parsed = parser.Parser('''
|
||||
parsed = parser.Parser(u('''
|
||||
def testit():
|
||||
a = """huhu
|
||||
asdfasdf""" + "h"
|
||||
''')
|
||||
'''))
|
||||
tok = parsed.module.subscopes[0].statements[0].token_list[2]
|
||||
self.assertEqual(tok.end_pos, (4, 11))
|
||||
|
||||
Reference in New Issue
Block a user