mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-20 20:41:13 +08:00
Make sure an assert no longer causes unnecessary trouble
Fixes #1426, fixes #1414
This commit is contained in:
@@ -131,7 +131,6 @@ class BuiltinSignature(AbstractSignature):
|
|||||||
return self.value
|
return self.value
|
||||||
|
|
||||||
def bind(self, value):
|
def bind(self, value):
|
||||||
assert not self.is_bound
|
|
||||||
return BuiltinSignature(value, self._return_string, is_bound=True)
|
return BuiltinSignature(value, self._return_string, is_bound=True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -414,3 +414,13 @@ def test_decorator(Script):
|
|||||||
|
|
||||||
d, = Script(code).goto_definitions()
|
d, = Script(code).goto_definitions()
|
||||||
assert d.docstring(raw=True) == 'Nice docstring'
|
assert d.docstring(raw=True) == 'Nice docstring'
|
||||||
|
|
||||||
|
|
||||||
|
def test_basic_str_init_signature(Script, disable_typeshed):
|
||||||
|
# See GH #1414 and GH #1426
|
||||||
|
code = dedent('''
|
||||||
|
class Foo(str):
|
||||||
|
pass
|
||||||
|
Foo(''')
|
||||||
|
c, = Script(code).call_signatures()
|
||||||
|
assert c.name == 'Foo'
|
||||||
|
|||||||
Reference in New Issue
Block a user