[red-knot] Explicitly test diagnostics are emitted for unresolvable submodule imports (#15035)

This commit is contained in:
Alex Waygood 2024-12-17 12:55:50 +00:00 committed by GitHub
parent dcb99cc817
commit 463046ae07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
```