|
| 1 | +--- |
| 2 | +source: crates/ty_test/src/lib.rs |
| 3 | +expression: snapshot |
| 4 | +--- |
| 5 | +--- |
| 6 | +mdtest name: basic.md - Structures - Attempting to import a stdlib submodule when both parts haven't yet been added |
| 7 | +mdtest path: crates/ty_python_semantic/resources/mdtest/import/basic.md |
| 8 | +--- |
| 9 | + |
| 10 | +# Python source files |
| 11 | + |
| 12 | +## mdtest_snippet.py |
| 13 | + |
| 14 | +``` |
| 15 | +1 | import compression.zstd # error: [unresolved-import] |
| 16 | +2 | from compression import zstd # error: [unresolved-import] |
| 17 | +3 | import compression.fakebutwhocansay # error: [unresolved-import] |
| 18 | +4 | from compression import fakebutwhocansay # error: [unresolved-import] |
| 19 | +``` |
| 20 | + |
| 21 | +# Diagnostics |
| 22 | + |
| 23 | +``` |
| 24 | +error[unresolved-import]: Cannot resolve imported module `compression.zstd` |
| 25 | + --> src/mdtest_snippet.py:1:8 |
| 26 | + | |
| 27 | +1 | import compression.zstd # error: [unresolved-import] |
| 28 | + | ^^^^^^^^^^^^^^^^ |
| 29 | +2 | from compression import zstd # error: [unresolved-import] |
| 30 | +3 | import compression.fakebutwhocansay # error: [unresolved-import] |
| 31 | + | |
| 32 | +info: The stdlib module `compression` is only available on Python 3.14+ |
| 33 | +info: Python 3.10 was assumed when resolving modules because it was specified on the command line |
| 34 | +info: rule `unresolved-import` is enabled by default |
| 35 | +
|
| 36 | +``` |
| 37 | + |
| 38 | +``` |
| 39 | +error[unresolved-import]: Cannot resolve imported module `compression` |
| 40 | + --> src/mdtest_snippet.py:2:6 |
| 41 | + | |
| 42 | +1 | import compression.zstd # error: [unresolved-import] |
| 43 | +2 | from compression import zstd # error: [unresolved-import] |
| 44 | + | ^^^^^^^^^^^ |
| 45 | +3 | import compression.fakebutwhocansay # error: [unresolved-import] |
| 46 | +4 | from compression import fakebutwhocansay # error: [unresolved-import] |
| 47 | + | |
| 48 | +info: The stdlib module `compression` is only available on Python 3.14+ |
| 49 | +info: Python 3.10 was assumed when resolving modules because it was specified on the command line |
| 50 | +info: rule `unresolved-import` is enabled by default |
| 51 | +
|
| 52 | +``` |
| 53 | + |
| 54 | +``` |
| 55 | +error[unresolved-import]: Cannot resolve imported module `compression.fakebutwhocansay` |
| 56 | + --> src/mdtest_snippet.py:3:8 |
| 57 | + | |
| 58 | +1 | import compression.zstd # error: [unresolved-import] |
| 59 | +2 | from compression import zstd # error: [unresolved-import] |
| 60 | +3 | import compression.fakebutwhocansay # error: [unresolved-import] |
| 61 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 62 | +4 | from compression import fakebutwhocansay # error: [unresolved-import] |
| 63 | + | |
| 64 | +info: The stdlib module `compression` is only available on Python 3.14+ |
| 65 | +info: Python 3.10 was assumed when resolving modules because it was specified on the command line |
| 66 | +info: rule `unresolved-import` is enabled by default |
| 67 | +
|
| 68 | +``` |
| 69 | + |
| 70 | +``` |
| 71 | +error[unresolved-import]: Cannot resolve imported module `compression` |
| 72 | + --> src/mdtest_snippet.py:4:6 |
| 73 | + | |
| 74 | +2 | from compression import zstd # error: [unresolved-import] |
| 75 | +3 | import compression.fakebutwhocansay # error: [unresolved-import] |
| 76 | +4 | from compression import fakebutwhocansay # error: [unresolved-import] |
| 77 | + | ^^^^^^^^^^^ |
| 78 | + | |
| 79 | +info: The stdlib module `compression` is only available on Python 3.14+ |
| 80 | +info: Python 3.10 was assumed when resolving modules because it was specified on the command line |
| 81 | +info: rule `unresolved-import` is enabled by default |
| 82 | +
|
| 83 | +``` |
0 commit comments