Add some additional tests for relative imports

This commit is contained in:
Charlie Marsh 2023-02-06 21:13:23 -05:00
parent 097c679cf3
commit 95fef43c4d
4 changed files with 20 additions and 6 deletions

View file

@ -12,6 +12,13 @@ def f():
x: Literal["foo"]
def f():
from . import typical
# OK
x: typical.Literal["foo"]
def f():
from .atypical import Literal

View file

@ -12,6 +12,13 @@ def f():
x: Literal["foo"]
def f():
from .. import typical
# OK
x: typical.Literal["foo"]
def f():
from .typical import Literal

View file

@ -6,10 +6,10 @@ expression: diagnostics
UndefinedName:
name: foo
location:
row: 19
row: 26
column: 15
end_location:
row: 19
row: 26
column: 20
fix: ~
parent: ~
@ -17,10 +17,10 @@ expression: diagnostics
UndefinedName:
name: foo
location:
row: 26
row: 33
column: 15
end_location:
row: 26
row: 33
column: 20
fix: ~
parent: ~

View file

@ -6,10 +6,10 @@ expression: diagnostics
UndefinedName:
name: foo
location:
row: 19
row: 26
column: 15
end_location:
row: 19
row: 26
column: 20
fix: ~
parent: ~