Skip to content

Commit 64e1eb1

Browse files
committed
Review: drop os.path from the two _dynamic_libs test files
Follow-up to mdboom's review. test_search_steps.py and test_ctk_root_discovery.py were already os.path-free; test_driver_lib_loading.py and test_load_nvidia_dynamic_lib.py each had one os.path.isfile left, now Path(...).is_file(). The remaining os. uses in both files are os.environ. The other cuda_pathfinder test files that still use os.path cover _binaries, _headers, _static_libs and _utils -- other parts of NVIDIA#2410, not this one.
1 parent 2bda8e8 commit 64e1eb1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎cuda_pathfinder/tests/test_driver_lib_loading.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010

1111
import os
12+
from pathlib import Path
1213

1314
import pytest
1415
from child_load_nvidia_dynamic_lib_helper import (
@@ -157,7 +158,7 @@ def raise_child_process_failed():
157158
abs_path = payload.abs_path
158159
assert abs_path is not None
159160
info_summary_append(f"abs_path={quote_for_shell(abs_path)}")
160-
assert os.path.isfile(abs_path)
161+
assert Path(abs_path).is_file()
161162

162163

163164
def test_real_query_driver_cuda_version(info_summary_append):

‎cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import os
55
import platform
6+
from pathlib import Path
67

78
import pytest
89
from child_load_nvidia_dynamic_lib_helper import (
@@ -159,4 +160,4 @@ def raise_child_process_failed():
159160
abs_path = payload.abs_path
160161
assert abs_path is not None
161162
info_summary_append(f"abs_path={quote_for_shell(abs_path)}")
162-
assert os.path.isfile(abs_path) # double-check the abs_path
163+
assert Path(abs_path).is_file() # double-check the abs_path

0 commit comments

Comments
 (0)