[semantic error tests]: refactor semantic error tests to separate files#20926
[semantic error tests]: refactor semantic error tests to separate files#20926ntBre merged 12 commits intoastral-sh:mainfrom
Conversation
|
Nice, thanks for working on this! Let me know when it's ready for review, or if you need any help. It looks like you're on the right track :) |
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <soni5happy@gmail.com>
9d88226 to
ed24d8c
Compare
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <soni5happy@gmail.com>
|
CI is green : ) , its ready for review. Thank you |
|
ntBre
left a comment
There was a problem hiding this comment.
Thank you! I had a few small nits, but this looks great. I think this will make these tests a lot easier to work with.
crates/ruff_linter/src/linter.rs
Outdated
There was a problem hiding this comment.
Do we need this filter? It looks like we use test_contents_syntax_errors in other tests in this file without the filter, so it would probably be okay to omit it.
crates/ruff_linter/src/linter.rs
Outdated
There was a problem hiding this comment.
It looks like we're adding the Python version twice, once here and once above on line 1033.
crates/ruff_linter/src/linter.rs
Outdated
There was a problem hiding this comment.
I think we could probably omit the error_type and just use the path instead. That seems closer to what we do for lint rules, and it will make the test_case entries a bit shorter.
Looking back at the blame, I'm actually not sure why we added error_type in the first place.
There was a problem hiding this comment.
path is causing windows test to fail .
crates/ruff_linter/src/linter.rs
Outdated
There was a problem hiding this comment.
It looks like most of these only have one Python version, so I'd probably just pass a single Python version, like we had before. And then we can duplicate the test_case like:
#[test_case(Path::new("some_file.py"), PythonVersion::PY311)]
#[test_case(Path::new("some_file.py"), PythonVersion::PY312)]I think that looks a bit neater.
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <soni5happy@gmail.com>
Signed-off-by: 11happy <soni5happy@gmail.com>
ntBre
left a comment
There was a problem hiding this comment.
Thank you! I had a handful of additional naming/version nits, but I think this is good to go otherwise.
Signed-off-by: 11happy <soni5happy@gmail.com>
…l-constraint-sets
* dcreager/refactor-constraint-mdtests: (60 commits)
add static_asserts
move all reveal diagnostics to separate line
add more gradual tests
better comment
restructure a bit
better names/comments
simplify before implication
two typevars!
mdformat
rename mdtest
move is_subtype_of_given into ConstraintSet
move where we grab these
add ConstraintSet.{always,never}
move range_constraint into ConstraintSet class
[ty] Rename `inner` query for better debugging experience (#21106)
[ty] Add new "constraint implication" typing relation (#21010)
[semantic error tests]: refactor semantic error tests to separate files (#20926)
Respect `--output-format` with `--watch` (#21097)
[`pyflakes`] Revert to stable behavior if imports for module lie in alternate branches for `F401` (#20878)
Fix finding keyword range for clause header after statement ending with semicolon (#21067)
...
Summary
This PR refactors semantic error tests in each seperate file
Test Plan
CC