ruff/crates/ty/tests/cli
Alex Waygood a57e291311
[ty] Add hint about resolved Python version when a user attempts to import a member added on a newer version (#21615)
## Summary

Fixes https://github.com/astral-sh/ty/issues/1620. #20909 added hints if
you do something like this and your Python version is set to 3.10 or
lower:

```py
import typing

typing.LiteralString
```

And we also have hints if you try to do something like this and your
Python version is set too low:

```py
from stdlib_module import new_submodule
```

But we don't currently have any subdiagnostic hint if you do something
like _this_ and your Python version is set too low:

```py
from typing import LiteralString
```

This PR adds that hint!

## Test Plan

snapshots

---------

Co-authored-by: Aria Desires <aria.desires@gmail.com>
2025-11-24 15:12:01 +00:00
..
config_option.rs [ty] Remove 'pre-release software' warning (#20817) 2025-10-13 19:50:19 +02:00
exit_code.rs [ty] Improve diagnostic range for `non-subscriptable` diagnostics (#21461) 2025-11-14 21:15:14 +00:00
file_selection.rs [ty] Fix `--exclude` and `src.exclude` merging (#21341) 2025-11-10 12:52:45 +01:00
main.rs [ty] Exit with `2` if there's any IO error (#21508) 2025-11-19 09:39:19 +01:00
python_environment.rs [ty] Add hint about resolved Python version when a user attempts to import a member added on a newer version (#21615) 2025-11-24 15:12:01 +00:00
rule_selection.rs [ty] Add suggestion to unknown rule diagnostics, rename `unknown-rule` lint to `ignore-comment-unknown-rule` (#20948) 2025-10-18 12:44:21 +02:00