-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[red-knot] Make infer.rs
unit tests independent of public symbol inference
#15690
Merged
sharkdp
merged 1 commit into
main
from
david/infer-unit-tests-no-public-symbol-dependence
Jan 23, 2025
Merged
[red-knot] Make infer.rs
unit tests independent of public symbol inference
#15690
sharkdp
merged 1 commit into
main
from
david/infer-unit-tests-no-public-symbol-dependence
Jan 23, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sharkdp
requested review from
carljm,
MichaReiser and
AlexWaygood
as code owners
January 23, 2025 13:22
sharkdp
commented
Jan 23, 2025
Comment on lines
+6041
to
+6056
#[track_caller] | ||
fn assert_diagnostic_messages(diagnostics: &TypeCheckDiagnostics, expected: &[&str]) { | ||
let messages: Vec<&str> = diagnostics | ||
.iter() | ||
.map(|diagnostic| diagnostic.message()) | ||
.collect(); | ||
assert_eq!(&messages, expected); | ||
} | ||
|
||
#[track_caller] | ||
fn assert_file_diagnostics(db: &TestDb, filename: &str, expected: &[&str]) { | ||
let file = system_path_to_file(db, filename).unwrap(); | ||
let diagnostics = check_types(db, file); | ||
|
||
assert_diagnostic_messages(diagnostics, expected); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just brings back two functions that I previously deleted.
sharkdp
changed the title
[red-knot] Make
[red-knot] Make Jan 23, 2025
infer.rs
unit tests independent from public symbol inferenceinfer.rs
unit tests independent of public symbol inference
AlexWaygood
approved these changes
Jan 23, 2025
sharkdp
deleted the
david/infer-unit-tests-no-public-symbol-dependence
branch
January 23, 2025 13:30
dcreager
added a commit
that referenced
this pull request
Jan 24, 2025
* main: [red-knot] MDTests: Do not depend on precise public-symbol type inference (#15691) [red-knot] Make `infer.rs` unit tests independent of public symbol inference (#15690) Tidy knot CLI tests (#15685) [red-knot] Port comprehension tests to Markdown (#15688) Create Unknown rule diagnostics with a source range (#15648) [red-knot] Port 'deferred annotations' unit tests to Markdown (#15686) [red-knot] Support custom typeshed Markdown tests (#15683) Don't run the linter ecosystem check on PRs that only touch red-knot crates (#15687) Add `rules` table to configuration (#15645) [red-knot] Make `Diagnostic::file` optional (#15640) [red-knot] Add test for nested attribute access (#15684) [red-knot] Anchor relative paths in configurations (#15634) [`pyupgrade`] Handle multiple base classes for PEP 695 generics (`UP046`) (#15659) [`pyflakes`] Treat arguments passed to the `default=` parameter of `TypeVar` as type expressions (`F821`) (#15679) Upgrade zizmor to the latest version in CI (#15649) [`pyupgrade`] Add rules to use PEP 695 generics in classes and functions (`UP046`, `UP047`) (#15565) [red-knot] Ensure a gradual type can always be assigned to itself (#15675)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Make the remaining
infer.rs
unit tests independent from public symbol type inference decisions (see upcoming change in #15674).Test Plan
assert_type
assertions is changed.