Fix an issue with creating contexts.

This commit is contained in:
Dave Halter
2017-01-05 18:05:24 +01:00
parent 12a9ef48f7
commit 9fb2644f03
5 changed files with 33 additions and 19 deletions

View File

@@ -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'