forked from VimPlug/jedi
fix test case for python3.3
This commit is contained in:
@@ -494,7 +494,7 @@ class Script(object):
|
|||||||
origins = cache.cache_call_signatures(_callable, user_stmt)
|
origins = cache.cache_call_signatures(_callable, user_stmt)
|
||||||
debug.speed('func_call followed')
|
debug.speed('func_call followed')
|
||||||
|
|
||||||
return [classes.CallSignature(self._evaluator, o, index, call) for o in origins
|
return [classes.CallSignature(self._evaluator, o, call, index) for o in origins
|
||||||
if o.isinstance(er.Function, er.Instance, er.Class)
|
if o.isinstance(er.Function, er.Instance, er.Class)
|
||||||
or isinstance(o, compiled.CompiledObject) and o.type() != 'module']
|
or isinstance(o, compiled.CompiledObject) and o.type() != 'module']
|
||||||
|
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ class CallSignature(object):
|
|||||||
It knows what functions you are currently in. e.g. `isinstance(` would
|
It knows what functions you are currently in. e.g. `isinstance(` would
|
||||||
return the `isinstance` function. without `(` it would return nothing.
|
return the `isinstance` function. without `(` it would return nothing.
|
||||||
"""
|
"""
|
||||||
def __init__(self, evaluator, executable, index, call):
|
def __init__(self, evaluator, executable, call, index):
|
||||||
self._evaluator = evaluator
|
self._evaluator = evaluator
|
||||||
self._executable = executable
|
self._executable = executable
|
||||||
self.index = index
|
self.index = index
|
||||||
@@ -572,8 +572,10 @@ class CallSignature(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def bracket_start(self):
|
def bracket_start(self):
|
||||||
""" The indent of the bracket that is responsible for the last function
|
"""
|
||||||
call. """
|
The indent of the bracket that is responsible for the last function
|
||||||
|
call.
|
||||||
|
"""
|
||||||
c = self._call
|
c = self._call
|
||||||
while c.next is not None:
|
while c.next is not None:
|
||||||
c = c.next
|
c = c.next
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import textwrap
|
|||||||
|
|
||||||
from ..helpers import TestCase
|
from ..helpers import TestCase
|
||||||
from jedi import Script
|
from jedi import Script
|
||||||
|
from jedi._compatibility import is_py33
|
||||||
|
|
||||||
|
|
||||||
class TestCallSignatures(TestCase):
|
class TestCallSignatures(TestCase):
|
||||||
@@ -167,7 +168,12 @@ class TestParams(TestCase):
|
|||||||
return signatures[0].params
|
return signatures[0].params
|
||||||
|
|
||||||
def test_param_name(self):
|
def test_param_name(self):
|
||||||
|
if not is_py33:
|
||||||
p = self.params('''int(''')
|
p = self.params('''int(''')
|
||||||
# int is defined as: `int(x[, base])`
|
# int is defined as: `int(x[, base])`
|
||||||
assert p[0].name == 'x'
|
assert p[0].name == 'x'
|
||||||
assert p[1].name == 'base'
|
assert p[1].name == 'base'
|
||||||
|
|
||||||
|
p = self.params('''open(something,''')
|
||||||
|
assert p[0].name in ['file', 'name']
|
||||||
|
assert p[1].name == 'mode'
|
||||||
|
|||||||
Reference in New Issue
Block a user