Skip to content

[ty] Add snapshot tests for advanced invalid-assignment scenarios#23581

Merged
sharkdp merged 2 commits intomainfrom
david/invalid-assignment-tests
Feb 27, 2026
Merged

[ty] Add snapshot tests for advanced invalid-assignment scenarios#23581
sharkdp merged 2 commits intomainfrom
david/invalid-assignment-tests

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Feb 26, 2026

Summary

Add some basic scenarios for invalid-assignment diagnostics that we plan to improve in the near future.

The snapshots don't really need to be reviewed (I skimmed them). They only document the status quo.

@sharkdp sharkdp added testing Related to testing Ruff itself ty Multi-file analysis & type inference labels Feb 26, 2026
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could easily add more exhaustive tests to almost all subsections. But I'd rather do that while working on the actual implementation, instead of coming up with all corner cases right away. For now, this mainly contains the scenarios that I think are most important (in the sense that users would benefit from ty improving error messages in that area).

@sharkdp sharkdp force-pushed the david/invalid-assignment-tests branch from b9cf5ff to 26936c0 Compare February 26, 2026 13:06
@sharkdp sharkdp marked this pull request as ready for review February 26, 2026 13:06
@carljm carljm assigned carljm and unassigned dcreager Feb 26, 2026
@sharkdp sharkdp merged commit 90fa4fd into main Feb 27, 2026
46 checks passed
@sharkdp sharkdp deleted the david/invalid-assignment-tests branch February 27, 2026 06:22
carljm added a commit that referenced this pull request Feb 27, 2026
* main:
  [ty] Take myself out of the reviewer pool for the next few days (#23618)
  [ty] Fix bug where ty would think that a `Callable` with a variadic positional parameter could be a subtype of a `Callable` with a positional-or-keyword parameter (#23610)
  [`ruff`] Add fix for `none-not-at-end-of-union` (`RUF036`)  (#22829)
  Bump cargo dist to 0.31 (#23614)
  [`pyflakes`] Fix false positive for names shadowing re-exports (`F811`) (#23356)
  [`fastapi`] Handle callable class dependencies with `__call__` method (`FAST003`) (#23553)
  [ty] Recurse into tuples and nested tuples when applying special-cased validation of `isinstance()` and `issubclass()` (#23607)
  Update typing conformance suite commit (#23606)
  [ty] Detect invalid uses of `@final` on non-methods (#23604)
  [ty] Move the type hierarchy request handlers to individual modules
  [ty] Wire up the type hierarchy implementation with the LSP
  [ty] Add routine for mapping from system path to vendored path
  [ty] Implement internal routines for providing the LSP "type hierarchy" feature
  [ty] Add some helper methods on `ClassLiteral`
  [ty] Move some module name helper routines to methods on `ModuleName`
  [ty] Bump version of `lsp-types`
  [ty] Refactor to support building constraint sets differently (#23600)
  [ty] Dataclass transform: neither frozen nor non-frozen (#23366)
  [ty] Add snapshot tests for advanced `invalid-assignment` scenarios (#23581)
  [ty] disallow negative narrowing on SubclassOf types (#23598)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants