Skip to content

testing: (tensor) Add Python unit tests for PadOp and YieldOp#5677

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/test-this-functionality
Draft

testing: (tensor) Add Python unit tests for PadOp and YieldOp#5677
Copilot wants to merge 2 commits intomainfrom
copilot/test-this-functionality

Conversation

Copy link

Copilot AI commented Feb 25, 2026

Adds Python API unit tests for tensor.pad and tensor.yield operations introduced in #5669, consistent with the existing test style in tests/dialects/test_tensor.py.

  • test_pad_op_static — constructs a PadOp with fully static low/high padding, verifies operands, static padding arrays, nofold=None, and result type
  • test_pad_op_dynamic — constructs a PadOp with mixed static/dynamic padding and nofold=UnitAttr(), verifies dynamic SSA operands are stored and DYNAMIC_INDEX sentinels appear correctly in the static arrays
  • test_yield_op — verifies YieldOp name and operand storage via arguments

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: tobiasgrosser <521960+tobiasgrosser@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests for new functionality tests: (tensor) Add Python unit tests for PadOp and YieldOp Feb 25, 2026
Copilot AI requested a review from tobiasgrosser February 25, 2026 08:37
@superlopuh superlopuh added the testing Tests (pytest, filecheck, testing infrastructure) label Feb 25, 2026
@superlopuh superlopuh changed the title tests: (tensor) Add Python unit tests for PadOp and YieldOp testing: (tensor) Add Python unit tests for PadOp and YieldOp Feb 25, 2026
Comment on lines +171 to +172
assert len(yield_op.arguments) == 1
assert yield_op.arguments[0] is pval_v
Copy link
Member

Choose a reason for hiding this comment

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

Let's just test the tuple directly here and above, it prints a nicer message if it fails than if it fails at the incorrect length stage with 2 != 1 or whatever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Tests (pytest, filecheck, testing infrastructure)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants