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"] x: Literal["foo"]
def f():
from . import typical
# OK
x: typical.Literal["foo"]
def f(): def f():
from .atypical import Literal from .atypical import Literal

View file

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

View file

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

View file

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