Skip to content

Commit 81b09fb

Browse files
committed
Elaborate on the use of options()
1 parent 73aa747 commit 81b09fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

R/test.data.table.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@ test = function(num,x,y=TRUE,error=NULL,warning=NULL,message=NULL,output=NULL,no
433433
out = capture.output(print(x <- suppressMessages(withCallingHandlers(tryCatch(x, error=eHandler), warning=wHandler, message=mHandler))))
434434
}
435435
if (!is.null(options)) {
436+
# some of the options passed to test() may break internal data.table use below (e.g. invalid datatable.alloccol), so undo them ASAP
436437
base::options(old_options)
438+
# this is still registered for on.exit(), keep empty
437439
old_options <- list()
438440
}
439441
fail = FALSE

0 commit comments

Comments
 (0)