mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:23:11 +00:00
Add some additional tests for relative imports
This commit is contained in:
parent
097c679cf3
commit
95fef43c4d
4 changed files with 20 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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: ~
|
||||
|
|
|
@ -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: ~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue