Conversation
Several test modules define the same test function name twice. The second definition rebinds the module-level name, so pytest only collects the later one and the earlier test silently never runs. File-level `# ruff: noqa: F811` headers were hiding the lint signal. - test_expr.py: rename the second test_match_cast to test_match_cast_json_roundtrip; update the restored first test from the removed MatchCast.pattern field to MatchCast.ty.shape. - test_ast_printer.py: rename the first test_shape_expr to test_shape_expr_symbolic; ShapeExpr now requires int64 symbolic vars, so update the vars and expected printout accordingly. - test_runtime_nd_array.py: the second test_1d_view_of_first_half_of_1d_arr views the second half via relative_byte_offset; rename it to test_1d_view_of_second_half_of_1d_arr (matching the 2d variant). - test_transform_gradient_checkpoint.py: the second test_checkpoint_dag is a truncated copy without the Expected module or the assert_structural_equal check, and it was the one being collected. Remove it so the full test runs. - test_analysis.py / test_analysis_well_formed.py: remove byte-identical second copies of test_reshape_pattern_reject_reduction and test_incomplete_ty_must_be_consistent. Drop F811 from the file-level noqa headers that no longer need it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
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.
Several relax/runtime test modules define the same test function name twice. The second
defrebinds the module-level name, so pytest only collects the later one and the earlier test silently never runs. File-level# ruff: noqa: F811headers were hiding the lint signal (ruff check --select F811 --ignore-noqashows them).relax/test_expr.pytest_match_cast(two different tests)test_match_cast_json_roundtrip. The restored first test still used the removedMatchCast.patternfield → switched tob.ty.shape[i].same_as(m).relax/test_ast_printer.pytest_shape_expr(symbolic vars vs. constants)test_shape_expr_symbolic.ShapeExprnow requires int64 values, so the vars are int64 and the expected printout isExpr(value=`m`).runtime/test_runtime_nd_array.pytest_1d_view_of_first_half_of_1d_arrrelative_byte_offset=512 * 4→ rename totest_1d_view_of_second_half_of_1d_arr(mirrors the existing 2d pair).relax/test_transform_gradient_checkpoint.pytest_checkpoint_dagExpectedmodule and noassert_structural_equal. Removed it so the full test runs.relax/test_analysis.pytest_reshape_pattern_reject_reductionrelax/test_analysis_well_formed.pytest_incomplete_ty_must_be_consistentF811 is dropped from the file-level noqa headers that no longer need it (otherwise
RUF100fires).Left alone:
test_op_gradient_numeric.py::test_reshapehas the same issue, but it is LLVM-gated and I could not run it locally, so it is not included here.Testing
CPU build of current
main(ccd98e9,USE_LLVM OFF),pytestper file:relax/test_expr.pyrelax/test_ast_printer.pyruntime/test_runtime_nd_array.pyrelax/test_transform_gradient_checkpoint.pytest_checkpoint_dagnow includes the structural-equality check)relax/test_analysis.pyrelax/test_analysis_well_formed.pyWithout the two small updates, the restored
test_match_castfails withAttributeError: 'MatchCast' object has no attribute 'pattern'andtest_shape_expr_symbolicfails withthe value in ShapeType can only have dtype of int64, i.e. both had drifted while hidden.ruff check/ruff format --check(v0.12.3, repo config) pass on all six files.🤖 Generated with Claude Code