Skip to content

Rename the shadowed test_device in TestDLPack - #3210

Merged
antonwolfy merged 2 commits into
masterfrom
test-dlpack-duplicate-test-device
Dec 2, 2026
Merged

antonwolfy merged 2 commits into
masterfrom
test-dlpack-duplicate-test-device

Conversation

@antonwolfy

Copy link
Copy Markdown
Contributor

This PR renames the first of the two test_device methods in TestDLPack in dpnp/tests/test_dlpack.py to test_dlpack_device.

The second definition replaced the first, so pytest collected only the second one, which checks from_dlpack(x, device=x.__dlpack_device__()). The first one checks that __dlpack_device__ reports kDLOneAPI for an array, for its from_dlpack import and for a strided view, and it has not run since the second one was added. flake8 excludes dpnp/tests/*.py, so F811 did not report the redefinition. No other test in dpnp/tests is defined twice in the same class or module.

Both tests pass. This is a test-only change, so there is no changelog entry.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

`TestDLPack` defined `test_device` twice, so the second definition replaced the first and the check that `__dlpack_device__` reports `kDLOneAPI` for an array, its `from_dlpack` import and a strided view has not run since the second one was added. The first one is now `test_dlpack_device`.
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/index.html

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.22.0dev3=np2py314h8d9cdd5_71 ran successfully.
Passed: 1491
Failed: 0
Skipped: 6

@coveralls

coveralls commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

No base build to compare — test-dlpack-duplicate-test-device into master

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
Thank you @antonwolfy for bringing back the shadowed __dlpack_device__ test

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.

🟢 Approval recommended

No active review issues are recorded for the test rename that restores DLPack device-reporting coverage.

No open issues 🎉

What changed in this PR

Restores previously shadowed DLPack device-reporting test coverage without changing library behavior.

Changes:

  • Renames the first TestDLPack.test_device to test_dlpack_device, allowing pytest to collect both tests.
File Description
dpnp/​tests/​test_dlpack.py Gives the device-reporting test a unique name so it runs.

Review effort: Balanced

@antonwolfy
antonwolfy merged commit 0d902f2 into master Dec 2, 2026
45 checks passed
@antonwolfy
antonwolfy deleted the test-dlpack-duplicate-test-device branch December 2, 2026 19:42
github-actions Bot added a commit that referenced this pull request Dec 2, 2026
This PR renames the first of the two `test_device` methods in
`TestDLPack` in `dpnp/tests/test_dlpack.py` to `test_dlpack_device`.

The second definition replaced the first, so pytest collected only the
second one, which checks `from_dlpack(x, device=x.__dlpack_device__())`.
The first one checks that `__dlpack_device__` reports `kDLOneAPI` for an
array, for its `from_dlpack` import and for a strided view, and it has
not run since the second one was added. flake8 excludes
`dpnp/tests/*.py`, so F811 did not report the redefinition. No other
test in `dpnp/tests` is defined twice in the same class or module.

Both tests pass. This is a test-only change, so there is no changelog
entry.
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.

4 participants