mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:16 +00:00
[red-knot] Explicitly test diagnostics are emitted for unresolvable submodule imports (#15035)
This commit is contained in:
parent
dcb99cc817
commit
463046ae07
1 changed files with 13 additions and 0 deletions
|
@ -91,3 +91,16 @@ reveal_type(c.C) # revealed: Literal[C]
|
||||||
```py path=a/b/c.py
|
```py path=a/b/c.py
|
||||||
class C: ...
|
class C: ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Unresolvable submodule imports
|
||||||
|
|
||||||
|
```py
|
||||||
|
# Topmost component resolvable, submodule not resolvable:
|
||||||
|
import a.foo # error: [unresolved-import] "Cannot resolve import `a.foo`"
|
||||||
|
|
||||||
|
# Topmost component unresolvable:
|
||||||
|
import b.foo # error: [unresolved-import] "Cannot resolve import `b.foo`"
|
||||||
|
```
|
||||||
|
|
||||||
|
```py path=a/__init__.py
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue