Skip to content

Commit a300419

Browse files
committed
Fix: assert site-packages or dist-packages only if have_nvidia_nvshmem_package()
1 parent 7c30292 commit a300419

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cuda_pathfinder/tests/test_find_nvidia_headers.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ def test_find_libname_nvshmem(info_summary_append):
4444
info_summary_append(f"{hdr_dir=!r}")
4545
if STRICTNESS == "all_must_work" or have_nvidia_nvshmem_package():
4646
assert hdr_dir is not None
47-
hdr_dir_parts = hdr_dir.split(os.path.sep)
48-
assert any(
49-
sub_dir in hdr_dir_parts
50-
for sub_dir in (
51-
"site-packages", # pip install
52-
"dist-packages", # apt install
53-
)
54-
), hdr_dir
47+
if have_nvidia_nvshmem_package():
48+
hdr_dir_parts = hdr_dir.split(os.path.sep)
49+
assert any(
50+
sub_dir in hdr_dir_parts
51+
for sub_dir in (
52+
"site-packages", # pip install
53+
"dist-packages", # apt install
54+
)
55+
), hdr_dir

0 commit comments

Comments
 (0)