mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-21 08:58:28 +08:00
Add test_basedefinition_type
This commit is contained in:
23
test/test_api_classes.py
Normal file
23
test/test_api_classes.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
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')
|
||||||
Reference in New Issue
Block a user