forked from VimPlug/jedi
Fix a Python 3.9 issue on travis
This commit is contained in:
@@ -134,15 +134,7 @@ def test_infer_on_non_name(Script):
|
|||||||
def test_infer_on_generator(Script, environment):
|
def test_infer_on_generator(Script, environment):
|
||||||
script = Script('def x(): yield 1\ny=x()\ny')
|
script = Script('def x(): yield 1\ny=x()\ny')
|
||||||
def_, = script.infer()
|
def_, = script.infer()
|
||||||
if environment.version_info >= (3, 9):
|
assert def_.name == 'Generator'
|
||||||
# The Generator in Python 3.9 is properly inferred, however once it is
|
|
||||||
# converted from stub to Python, the definition is
|
|
||||||
# Generator = _SpecialGenericAlias(collections.abc.Generator, 3)
|
|
||||||
# This is pretty normal for most typing types, like Sequence, List,
|
|
||||||
# etc.
|
|
||||||
assert def_.name == '_SpecialGenericAlias'
|
|
||||||
else:
|
|
||||||
assert def_.name == 'Generator'
|
|
||||||
def_, = script.infer(only_stubs=True)
|
def_, = script.infer(only_stubs=True)
|
||||||
assert def_.name == 'Generator'
|
assert def_.name == 'Generator'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user