Skip to content

Commit

Permalink
actually fix test this time maybe?
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondben committed Feb 16, 2024
1 parent d059751 commit 1dbf719
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/testthat/test-network.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ test_that("basic inference", {


test_that("cuda fails on cpu-only system", {
have_cuda <- reticulate::py_run_string("import torch\ncuda=torch.cuda.is_available()")$cuda
have_cuda <- tryCatch({
reticulate::use_virtualenv(ovml_yolo7_python_envname())
reticulate::py_run_string("import torch\ncuda=torch.cuda.is_available()")$cuda
}, error = function(e) NA)
skip_if(is.na(have_cuda))
if (!have_cuda) {
expect_warning(ovml_yolo(device = 0), "device not available")
}
Expand Down

0 comments on commit 1dbf719

Please sign in to comment.