tests/testthat/test-exec.R

context("exec")

test_that("exception handling on executing Python code works", {
  expect_error(py.exec("raise Exception('oh noes')", stopOnException = TRUE), "oh noes")
  expect_warning(py.exec("raise Exception('oh noes')", stopOnException = FALSE), "oh noes")
})

Try the SnakeCharmR package in your browser

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

SnakeCharmR documentation built on May 2, 2019, 6:21 a.m.