mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Fix an issue with creating contexts.
This commit is contained in:
@@ -15,3 +15,16 @@ def test_empty_init():
|
||||
class X(object): pass
|
||||
X(''')
|
||||
assert Script(code).completions()
|
||||
|
||||
|
||||
def test_in_empty_space():
|
||||
code = dedent('''\
|
||||
class X(object):
|
||||
def __init__(self):
|
||||
hello
|
||||
''')
|
||||
comps = Script(code, 3, 7).completions()
|
||||
self, = [c for c in comps if c.name == 'self']
|
||||
assert self.name == 'self'
|
||||
def_, = self._goto_definitions()
|
||||
assert def_.name == 'X'
|
||||
|
||||
Reference in New Issue
Block a user