1
0
forked from VimPlug/jedi

Fix a few last tests, now Jedi's working again, tests are passing.

This commit is contained in:
Dave Halter
2014-09-26 16:02:03 +02:00
parent 6f29e802c2
commit 4d7db35340
3 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -461,13 +461,13 @@ def get_names_of_scope(evaluator, scope, position=None, star_search=True, includ
>>> from jedi.evaluate import Evaluator >>> from jedi.evaluate import Evaluator
>>> pairs = list(get_names_of_scope(Evaluator(), scope)) >>> pairs = list(get_names_of_scope(Evaluator(), scope))
>>> pairs[0] >>> pairs[0]
(<Function: func@3-5>, [<Name: y@4,4>]) (<Function: func@3-5>, [<NamePart: y@4,4>])
Then it yield the names from one level outer scope. For this example, this Then it yield the names from one level outer scope. For this example, this
is the most outer scope. is the most outer scope.
>>> pairs[1] >>> pairs[1]
(<ModuleWrapper: <SubModule: None@1-5>>, [<Name: x@2,0>, <Name: func@3,4>]) (<ModuleWrapper: <SubModule: None@1-5>>, [<NamePart: x@2,0>, <NamePart: func@3,4>])
After that we have a few underscore names that have been defined After that we have a few underscore names that have been defined
+2 -1
View File
@@ -1552,7 +1552,8 @@ class NamePart(object):
return self._string return self._string
def __repr__(self): def __repr__(self):
return "<%s: %s>" % (type(self).__name__, self._string) return "<%s: %s@%s,%s>" % (type(self).__name__, self._string,
self.start_pos[0], self.start_pos[1])
def get_code(self): def get_code(self):
return self._string return self._string
+1 -1
View File
@@ -5,7 +5,7 @@ from jedi import Script
def get_definition_and_evaluator(source): def get_definition_and_evaluator(source):
d = Script(dedent(source)).goto_definitions()[0] d = Script(dedent(source)).goto_definitions()[0]
return d._name.parent.parent, d._evaluator return d._name.parent, d._evaluator
def test_function_execution(): def test_function_execution():