Skip to content

[red-knot] Add more tests for * imports #17315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Apr 9, 2025

Summary

  • Add more tests for various edge cases, especially around visibility constraints
  • Split some tests up and add some more narrative description
  • Fix some minor bugs in various tests that weren't actually testing what they were meant to be testing
  • Where there is only one module exporting things, and only one module importing things, consistently name the first of these exporter.py and the second of these importer.py.

Test Plan

  • uvx pre-commit run -a
  • cargo test -p red_knot_python_semantic
  • Re-read it several times to make sure it made sense

@AlexWaygood AlexWaygood added testing Related to testing Ruff itself ty Multi-file analysis & type inference labels Apr 9, 2025
Copy link
Contributor

github-actions bot commented Apr 9, 2025

mypy_primer results

No ecosystem changes detected ✅

@AlexWaygood
Copy link
Member Author

This is a somewhat large PR, but I'm going to "bias towards action" and merge without review: I want to rebase #17286 on top of it, land that PR and then move onto other tasks. This PR also only makes changes to our test suite, not to any of our functionality. If anybody has any comments around any of the changes here, I'm very happy to tackle them in followup PRs!

Tests don't seem to be running in CI here... but I ran the tests locally so I'm pretty confident this won't break main 🤞

@AlexWaygood AlexWaygood merged commit f1ba596 into main Apr 9, 2025
22 checks passed
@AlexWaygood AlexWaygood deleted the alex/more-star-import-tests branch April 9, 2025 14:10
dcreager added a commit that referenced this pull request Apr 9, 2025
* main:
  [red-knot] Allow explicit specialization of generic classes (#17023)
  [`airflow`] Refactor `AIR301` logic and fix typos (`AIR301`) (#17293)
  [`airflow`] Extract `AIR312` from `AIR302` rules (`AIR302`, `AIR312`) (#17152)
  [red-knot] Improve handling of visibility constraints in external modules when resolving `*` imports (#17286)
  [red-knot] Add more tests for `*` imports (#17315)
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 9, 2025
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.

1 participant