Skip to content

Commit 115b831

Browse files
committed
added test to validate suggestions
1 parent 6ca3d6f commit 115b831

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

test-data/unit/check-errorcodes.test

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,25 @@ def f() -> None:
2121
[file m.py]
2222
[builtins fixtures/module.pyi]
2323

24+
[case testErrorCodeUndefinedNameSuggestion]
25+
my_variable = 42
26+
my_constant = 100
27+
28+
x = my_variabel # E: Name "my_variabel" is not defined; did you mean "my_variable"? [name-defined]
29+
30+
def calculate_sum(items: int) -> int:
31+
return items
32+
33+
calculate_summ(1) # E: Name "calculate_summ" is not defined; did you mean "calculate_sum"? [name-defined]
34+
35+
class MyClass:
36+
pass
37+
38+
y = MyClas() # E: Name "MyClas" is not defined; did you mean "MyClass"? [name-defined]
39+
40+
unknown_xyz # E: Name "unknown_xyz" is not defined [name-defined]
41+
[builtins fixtures/module.pyi]
42+
2443
[case testErrorCodeUnclassifiedError]
2544
class A:
2645
def __init__(self) -> int: \

0 commit comments

Comments
 (0)