Repository navigation
Rename the shadowed test_device in TestDLPack - #3210
Merged
Merged
Conversation
`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`.
antonwolfy
requested review from
ndgrigorian and
vlad-perevezentsev
as code owners
November 30, 2026 12:25
Contributor
|
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
Contributor
|
Array API standard conformance tests for dpnp=0.22.0dev3=np2py314h8d9cdd5_71 ran successfully. |
Collaborator
vlad-perevezentsev
approved these changes
Dec 1, 2026
vlad-perevezentsev
left a comment
Contributor
There was a problem hiding this comment.
LGTM
Thank you @antonwolfy for bringing back the shadowed __dlpack_device__ test
There was a problem hiding this comment.
🟢 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_devicetotest_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
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.
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.
This PR renames the first of the two
test_devicemethods inTestDLPackindpnp/tests/test_dlpack.pytotest_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__reportskDLOneAPIfor an array, for itsfrom_dlpackimport and for a strided view, and it has not run since the second one was added. flake8 excludesdpnp/tests/*.py, so F811 did not report the redefinition. No other test indpnp/testsis defined twice in the same class or module.Both tests pass. This is a test-only change, so there is no changelog entry.