Skip to content

Commit 3f50c4c

Browse files
committed
Minor tests corrections
1 parent b912881 commit 3f50c4c

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

src/test/kotlin/space/whitememory/pythoninlayparams/PythonFunctionReturnTypesTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class PythonFunctionReturnTypesTest : PythonAbstractInlayHintsTestCase() {
5757
def check_filled_hint() -> str:
5858
return ""
5959
60-
def async_check_filled_hint() -> str:
60+
async def async_check_filled_hint() -> str:
6161
return ""
6262
""".trimIndent()
6363
)
@@ -158,7 +158,7 @@ class PythonFunctionReturnTypesTest : PythonAbstractInlayHintsTestCase() {
158158
"""
159159
def
160160
161-
def test
161+
def test
162162
163163
def test()
164164

src/test/kotlin/space/whitememory/pythoninlayparams/PythonVariableTypesTest.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,23 @@ class PythonVariableTypesTest : PythonAbstractInlayHintsTestCase() {
5454
5555
def get_now():
5656
return datetime.datetime.now()
57+
58+
def get_any_dict():
59+
return {}
60+
61+
def get_complex_dict():
62+
return {1: A(), 2: None, 3: [], 4: tuple()}
63+
64+
def get_complex_list():
65+
return [1, [[], 1, '3'], '', []]
5766
""".trimIndent()
5867

5968
fun testSimple() = doTest(
6069
"""
6170
x1<# [: int] #> = get_int()
6271
x2<# [: [[list [ A ]] | None]] #> = get_optional()
6372
x3<# [: TestTyped] #> = get_typed_dict()
73+
x4<# [: dict] #> = get_any_dict()
6474
6575
x7<# [: [A | None]] #> = A() or None
6676
x8<# [: [A | None]] #> = A() and None
@@ -98,7 +108,9 @@ class PythonVariableTypesTest : PythonAbstractInlayHintsTestCase() {
98108
g4 = A.from_val(1)
99109
g5 = Union[int, str]
100110
# g6 = UnionChild[int, str]
111+
101112
g7 = {k: None for k, _ in range(10)}
113+
g8 = {1: A(), 2: None, 3: [], 4: tuple()}
102114
103115
h1 = datetime.datetime.now()
104116
h2 = datetime.datetime()
@@ -109,7 +121,7 @@ class PythonVariableTypesTest : PythonAbstractInlayHintsTestCase() {
109121
"""
110122
x<# [: [Coroutine [ Any , Any , int ]]] #> = coro()
111123
y<# [: [Coroutine [ Any , Any , int ]]] #> = x
112-
z<# [: int] #> = await x
124+
z<# [: int] #> = await y
113125
114126
f = 1
115127
g = f
@@ -120,7 +132,9 @@ class PythonVariableTypesTest : PythonAbstractInlayHintsTestCase() {
120132
fun testComplex() = doTest(
121133
"""
122134
x1<# [: [[list [ A ]] | None | list | ...]] #> = get_optional() or [] or {}
123-
long_types<# [: [list [ [int | [list [ [list | int | ...] ]] | ...] ]]] #> = [1, [[], 1, '3'], '', []]
135+
complex_list<# [: [list [ [int | [list [ [list | int | ...] ]] | ...] ]]] #> = get_complex_list()
136+
complex_dict<# [: [dict [ int , [A | None | list | ...] ]]] #> = get_complex_dict()
137+
124138
125139
coro_callable<# [: [() -> ( [Coroutine [ Any , Any , int ]] )]] #> = coro
126140
one_coro<# [: [Coroutine [ Any , Any , int ]]] #> = await get_coro()

0 commit comments

Comments
 (0)