Skip to content

Commit 2241dff

Browse files
committed
Move the remaining test os.path calls to pathlib
The three os.path.abspath assertions in test_find_nvidia_binaries.py become str(...absolute()), and the os.path.isdir in test_utils_find_sub_dirs.py becomes Path.is_dir(). import os stays in the binaries test for os.sep.
1 parent 8e3d5c7 commit 2241dff

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎cuda_pathfinder/tests/test_find_nvidia_binaries.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def test_find_binary_first_matching_dir_wins(monkeypatch, mocker):
571571
result = find_nvidia_binary_utility("nvcc")
572572

573573
# Conda comes before CUDA_HOME, so the Conda hit wins and CUDA_HOME is never probed.
574-
assert result == os.path.abspath(conda_nvcc)
574+
assert result == str(conda_nvcc.absolute())
575575
assert checked == [site_dir / "nvcc", conda_nvcc]
576576

577577

@@ -592,7 +592,7 @@ def test_find_binary_ctk_root_canary_fallback(monkeypatch, mocker):
592592

593593
result = find_nvidia_binary_utility("nvcc")
594594

595-
assert result == os.path.abspath(ctk_nvcc)
595+
assert result == str(ctk_nvcc.absolute())
596596
canary_mock.assert_called_once_with()
597597
# No earlier trusted dirs existed, so the only probe is the canary bin dir.
598598
assert checked == [ctk_nvcc]
@@ -637,7 +637,7 @@ def test_find_binary_canary_not_consulted_when_found_earlier(monkeypatch, mocker
637637

638638
result = find_nvidia_binary_utility("nvcc")
639639

640-
assert result == os.path.abspath(conda_nvcc)
640+
assert result == str(conda_nvcc.absolute())
641641
canary_mock.assert_not_called()
642642

643643

0 commit comments

Comments
 (0)