Skip to content

Commit 8916e8a

Browse files
committed
test: improve cuFile test ergonomics and reduce log noise
- Add @cache to isSupportedFilesystem(), cufileLibraryAvailable(), and cufileVersionLessThan() to avoid redundant checks and repeated INFO log messages - Set fixture scope for cufile_env_json to "module" to reduce env var churn
1 parent d142472 commit 8916e8a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cuda_bindings/tests/test_cufile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import platform
1010
import tempfile
1111
from contextlib import suppress
12+
from functools import cache
1213

1314
import pytest
1415

@@ -39,7 +40,7 @@ def platform_is_wsl():
3940
pytest.skip("skipping cuFile tests on WSL", allow_module_level=True)
4041

4142

42-
@pytest.fixture
43+
@pytest.fixture(scope="module")
4344
def cufile_env_json():
4445
"""Set CUFILE_ENV_PATH_JSON environment variable for async tests."""
4546
original_value = os.environ.get("CUFILE_ENV_PATH_JSON")
@@ -62,6 +63,7 @@ def cufile_env_json():
6263
os.environ.pop("CUFILE_ENV_PATH_JSON", None)
6364

6465

66+
@cache
6567
def cufileLibraryAvailable():
6668
"""Check if cuFile library is available on the system."""
6769
try:
@@ -74,6 +76,7 @@ def cufileLibraryAvailable():
7476
return False
7577

7678

79+
@cache
7780
def cufileVersionLessThan(target):
7881
"""Check if cuFile library version is less than target version."""
7982
try:
@@ -90,6 +93,7 @@ def cufileVersionLessThan(target):
9093
return True # Assume old version if any error occurs
9194

9295

96+
@cache
9397
def isSupportedFilesystem():
9498
"""Check if the current filesystem is supported (ext4 or xfs)."""
9599
try:

0 commit comments

Comments
 (0)