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")
})
asieira/SnakeCharmR documentation built on Jan. 3, 2020, 7:27 a.m.