Skip to content

TST: cover reflected scalar operators - #471

Open
Boulea7 wants to merge 1 commit into
data-apis:masterfrom
Boulea7:test/reflected-scalar-operators-460
Open

Boulea7 wants to merge 1 commit into
data-apis:masterfrom
Boulea7:test/reflected-scalar-operators-460

Conversation

@Boulea7

@Boulea7 Boulea7 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

The operator tests exercise array-left expressions but do not check scalar-left reflected arithmetic and bitwise operators. This adds cases for the seven reflected arithmetic methods and five reflected bitwise methods, checking dtype, shape, and values against the corresponding Array API functions. The inputs are small and finite, with nonzero divisors, small whole-number exponents, and valid shift counts.

With a temporary wrong-direction __rtruediv__, the five existing test_divide cases still pass while the new value assertion fails. The new assertions also detect temporary wrong-direction __rfloordiv__ and __rmod__ implementations. These checks establish test coverage; they do not indicate a defect in a current backend.

Validation: the new test has 115 passing cases with array-api-strict at both API 2025.12 and 2023.12, and 115 with NumPy at the suite's default API version. The related existing operator tests have 15 passing cases, and flake8 --select F passes. API 2021.12 cannot collect even the unchanged test_divide case because the existing helpers require __array_namespace_info__. The full suite was not run locally.

Refs #460

Copilot AI lite review requested due to automatic review settings September 28, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants