Skip to content

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

Open
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
rwgk:test_nvjitlink_context_manager
Open

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

Conversation

@rwgk
Copy link
Copy Markdown
Collaborator

@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
Collaborator Author

rwgk commented Apr 2, 2026

/ok to test

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

@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
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.

1 participant