mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 13:14:34 +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"]
|
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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: ~
|
||||||
|
|
|
||||||
|
|
@ -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: ~
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue