inst/testing/PyFunction.R

#' # pyImport
require(testthat)
require(PythonInR)
invisible(capture.output(pyConnect()))

expect_that(pyExec("import os"), equals(0))
fun <- pyFunction("os.getcwd")
expect_true( inherits(fun, "PythonInR_Object") )
expect_equal(fun(), getwd())

Try the PythonInR package in your browser

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

PythonInR documentation built on May 2, 2019, 5:17 p.m.