tests/testthat/test-subprocess.R

context("subprocess module")

test_that("subprocess.Popen works", {

  subprocess <- import("subprocess")

  # needs patching on Windows in the RStudio IDE
  # https://github.com/rstudio/reticulate/issues/1448
  expect_no_error({
    subprocess$Popen(
      c("ls", "."),
      shell = FALSE,
      stderr = subprocess$PIPE,
      stdout = subprocess$PIPE
    )
  })

})

test_that("modules that subclass Popen work", {

  expect_no_error({
    import("asyncio")
  })

})

Try the reticulate package in your browser

Any scripts or data that you put into this service are public.

reticulate documentation built on Oct. 13, 2023, 1:08 a.m.