Nothing
context("envs")
test_that("conda utility functions work as expected", {
# TODO: reenable these tests
skip_if_no_test_environments()
binary <- conda_binary()
expect_type(binary, "character")
expect_length(binary, 1)
conda_remove('reticulate-testthat')
conda_create('reticulate-testthat')
expect_true('reticulate-testthat' %in% conda_list()$name)
conda_install('reticulate-testthat', 'Pillow')
conda_remove('reticulate-testthat', 'Pillow')
conda_remove('reticulate-testthat')
expect_false('reticulate-testthat' %in% conda_list()$name)
conda_create('reticulate-testthat', forge = TRUE)
expect_true(all(grepl("conda-forge", conda_list_packages("reticulate-testthat")$channel)))
conda_remove('reticulate-testthat')
conda_create('reticulate-testthat', channel = c("anaconda"))
expect_true(all(grepl("anaconda", conda_list_packages("reticulate-testthat")$channel)))
conda_remove('reticulate-testthat')
})
test_that("virtualenv utility functions work as expected", {
skip_if_no_test_environments()
expect_error(
virtualenv_remove('reticulate-testthat', confirm = FALSE),
'Virtual environment \'reticulate-testthat\' does not exist.'
)
virtualenv_create('reticulate-testthat')
virtualenv_remove('reticulate-testthat', confirm = FALSE)
virtualenv_install('reticulate-testthat', 'Pillow')
virtualenv_install('reticulate-testthat', 'Pillow', ignore_installed = TRUE)
expect_true('reticulate-testthat' %in% virtualenv_list())
virtualenv_remove('reticulate-testthat', confirm = FALSE)
expect_false('reticulate-testthat' %in% virtualenv_list())
})
test_that("Python version checker support a 'x.x.*' pattern", {
check <- as_version_constraint_checkers("==3.12.*")
expect_false(check[[1]]("3.9"))
expect_true(check[[1]]("3.12"))
})
test_that("Python version checker returns expected error message", {
check <- as_version_constraint_checkers("==3.12.-")
expect_error(check[[1]]("3.12"), "Version `==3.12.-` is not valid.")
})
test_that("Python version checker does not support pattern 'x.*.x'", {
check <- as_version_constraint_checkers(">=3.*.11")
expect_false(check[[1]]("3.12"))
expect_false(check[[1]]("4.1"))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.