Skip to content

test(bindings): nvjitlink_session for reliable teardown in nvjitlink tests#1852

Merged
rwgk merged 1 commit intoNVIDIA:mainfrom
rwgk:test_nvjitlink_context_manager
Apr 10, 2026
Merged

test(bindings): nvjitlink_session for reliable teardown in nvjitlink tests#1852
rwgk merged 1 commit intoNVIDIA:mainfrom
rwgk:test_nvjitlink_context_manager

Conversation

@rwgk
Copy link
Copy Markdown
Contributor

@rwgk rwgk commented Apr 2, 2026

Quick drive-by cleanup.

Wrap nvjitlink.create / nvjitlink.destroy usage in a small context manager so handles are always destroyed, including when a test fails on an assertion or raises mid-way. This matches the existing pattern in test_nvvm.py (nvvm_program).

Why bother: Tests are often copied or used as reference when adding new code. Keeping resource handling explicit and correct in tests helps avoid spreading lower-quality patterns elsewhere.

@rwgk rwgk added this to the cuda.bindings next milestone Apr 2, 2026
@rwgk rwgk self-assigned this Apr 2, 2026
@rwgk rwgk added P2 Low priority - Nice to have test Improvements or additions to tests cuda.bindings Everything related to the cuda.bindings module labels Apr 2, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented Apr 2, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rwgk
Copy link
Copy Markdown
Contributor Author

rwgk commented Apr 2, 2026

/ok to test

@github-actions

This comment has been minimized.

@rwgk rwgk marked this pull request as ready for review April 2, 2026 19:44
@rwgk rwgk requested a review from mdboom April 2, 2026 19:44
@rwgk rwgk merged commit d3be043 into NVIDIA:main Apr 10, 2026
98 checks passed
@rwgk rwgk deleted the test_nvjitlink_context_manager branch April 10, 2026 19:14
@github-actions
Copy link
Copy Markdown

Doc Preview CI
Preview removed because the pull request was closed or merged.

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

Labels

cuda.bindings Everything related to the cuda.bindings module P2 Low priority - Nice to have test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants