summaryrefslogtreecommitdiff
path: root/tests/test_cuda_setup_evaluator.py
diff options
context:
space:
mode:
authorTim Dettmers <tim.dettmers@gmail.com>2022-10-24 11:54:25 -0700
committerTim Dettmers <tim.dettmers@gmail.com>2022-10-24 11:54:25 -0700
commitdf86625a9399d16d6fb2e3bab6bb7bcc729f3b7d (patch)
tree34278a2cfd443d8e6f62aaba0f7a469db2807571 /tests/test_cuda_setup_evaluator.py
parentb844e104b79ddc06161ff975aa93ffa9a7ec4801 (diff)
Isolated CUDASetup logging; all tests green.
Diffstat (limited to 'tests/test_cuda_setup_evaluator.py')
-rw-r--r--tests/test_cuda_setup_evaluator.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/tests/test_cuda_setup_evaluator.py b/tests/test_cuda_setup_evaluator.py
index c947ca1..6fbd29f 100644
--- a/tests/test_cuda_setup_evaluator.py
+++ b/tests/test_cuda_setup_evaluator.py
@@ -80,44 +80,12 @@ def happy_path_path_string(tmpdir, request):
if CUDA_RUNTIME_LIB in path:
(test_input / CUDA_RUNTIME_LIB).touch()
-
-@pytest.mark.parametrize("test_input, expected", HAPPY_PATH__LD_LIB_TEST_PATHS)
-def test_determine_cuda_runtime_lib_path__happy_path(
- tmp_path, test_input: str, expected: str
-):
- for path in extract_candidate_paths(test_input):
- path.mkdir()
- (path / CUDA_RUNTIME_LIB).touch()
- assert determine_cuda_runtime_lib_path(test_input) == expected
-
-
UNHAPPY_PATH__LD_LIB_TEST_PATHS = [
f"a/b/c/{CUDA_RUNTIME_LIB}:d/e/f/{CUDA_RUNTIME_LIB}",
f"a/b/c/{CUDA_RUNTIME_LIB}:d/e/f/{CUDA_RUNTIME_LIB}:g/h/j/{CUDA_RUNTIME_LIB}",
]
-@pytest.mark.parametrize("test_input", UNHAPPY_PATH__LD_LIB_TEST_PATHS)
-def test_determine_cuda_runtime_lib_path__unhappy_path(tmp_path, test_input: str):
- test_input = tmp_path / test_input
- (test_input / CUDA_RUNTIME_LIB).touch()
- with pytest.raises(FileNotFoundError) as err_info:
- determine_cuda_runtime_lib_path(test_input)
- assert all(match in err_info for match in {"duplicate", CUDA_RUNTIME_LIB})
-
-
-def test_determine_cuda_runtime_lib_path__non_existent_dir(capsys, tmp_path):
- existent_dir = tmp_path / "a/b"
- existent_dir.mkdir()
- non_existent_dir = tmp_path / "c/d" # non-existent dir
- test_input = ":".join([str(existent_dir), str(non_existent_dir)])
-
- determine_cuda_runtime_lib_path(test_input)
- std_err = capsys.readouterr().err
-
- assert all(match in std_err for match in {"WARNING", "non-existent"})
-
-
def test_full_system():
## this only tests the cuda version and not compute capability