1
0
forked from VimPlug/jedi

signature is now a subclass of definitions

This commit is contained in:
Dave Halter
2014-03-14 13:32:03 +01:00
parent e13f0a60d2
commit 064f161acc
3 changed files with 17 additions and 15 deletions

View File

@@ -180,7 +180,7 @@ class TestParams(TestCase):
assert p[1].name == 'mode'
def test_signature_is_definition(TestCase):
def test_signature_is_definition():
"""
Through inheritance, a call signature is a sub class of Definition.
Check if the attributes match.
@@ -193,9 +193,11 @@ def test_signature_is_definition(TestCase):
# Now compare all the attributes that a CallSignature must also have.
for attr_name in dir(definition):
if attr_name.startswith('_') or attr_name == 'defined_names':
continue
attribute = getattr(definition, attr_name)
signature_attribute = getattr(signature, attr_name)
if inspect.isfunction(attribute):
if inspect.ismethod(attribute):
assert attribute() == signature_attribute()
else:
assert attribute == signature_attribute