def test_rmarkdown(self): # install rmarkdown if missing r(''' packages <- c('rmarkdown') new.packages <- packages[!(packages %in% installed.packages()[,"Package"])] if (length(new.packages)) install.packages(new.packages) ''') def _callback(f): f = f.result() return f path = server.info.folder / 'dir/rmarkdown.Rmd' handler = AttrDict(file=path) result = rmarkdown('', handler).add_done_callback(_callback) self.check('/dir/transform/rmarkdown.Rmd', text=result) htmlpath = str(server.info.folder / 'dir/rmarkdown.html') tempfiles[htmlpath] = htmlpath
def test_rmarkdown(self): # rmarkdown must be installed ok_(r('"rmarkdown" %in% installed.packages()')[0], 'rmarkdown must be installed. Run conda install -c r r-rmarkdown') def _callback(f): f = f.result() return f path = server.info.folder / 'dir/rmarkdown.Rmd' handler = AttrDict(file=path) result = rmarkdown('', handler).add_done_callback(_callback) try: self.check('/dir/transform/rmarkdown.Rmd', text=result) except AssertionError: raise SkipTest('TODO: Once NumPy & rpy2 work together, remove this SkipTest. #259') htmlpath = str(server.info.folder / 'dir/rmarkdown.html') tempfiles[htmlpath] = htmlpath
def test_rmarkdown(self): if os.environ.get('BRANCH', '') not in {'dev', 'master'}: raise SkipTest('Install slow rmarkdown installation only on dev/master') # install rmarkdown if missing r(''' packages <- c('rmarkdown') new.packages <- packages[!(packages %in% installed.packages()[,"Package"])] if (length(new.packages)) install.packages(new.packages) ''') def _callback(f): f = f.result() return f path = server.info.folder / 'dir/rmarkdown.Rmd' handler = AttrDict(file=path) result = rmarkdown('', handler).add_done_callback(_callback) self.check('/dir/transform/rmarkdown.Rmd', text=result) htmlpath = str(server.info.folder / 'dir/rmarkdown.html') tempfiles[htmlpath] = htmlpath