mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
24 lines
417 B
Python
24 lines
417 B
Python
import pytest
|
|
|
|
from jedi import api
|
|
|
|
|
|
def make_definitions():
|
|
return api.defined_names("""
|
|
import sys
|
|
|
|
class C:
|
|
pass
|
|
|
|
x = C()
|
|
|
|
def f():
|
|
pass
|
|
""")
|
|
|
|
|
|
@pytest.mark.parametrize('definition', make_definitions())
|
|
def test_basedefinition_type(definition):
|
|
assert definition.type in ('module', 'class', 'instance', 'function',
|
|
'statement', 'import')
|