We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ee6aa2 commit f276cd6Copy full SHA for f276cd6
cuda_bindings/tests/test_nvjitlink.py
@@ -7,7 +7,7 @@
7
# is strictly prohibited.
8
9
import pytest
10
-import os
+
11
from cuda.bindings import nvjitlink
12
13
@@ -76,16 +76,13 @@ def test_add_data():
76
nvjitlink.destroy(handle)
77
78
79
-def test_add_file():
+def test_add_file(tmp_path):
80
handle = nvjitlink.create(1, ["-arch=sm_90"])
81
- file_path = "test_file.cubin"
82
- with open (file_path, "wb") as f:
83
- f.write(ptx_kernel_bytes)
84
-
+ file_path = tmp_path / "test_file.cubin"
+ file_path.write_bytes(ptx_kernel_bytes)
85
nvjitlink.add_file(handle, nvjitlink.InputType.ANY, str(file_path))
86
nvjitlink.complete(handle)
87
88
- os.remove(file_path)
89
90
91
def test_get_error_log():
0 commit comments