Skip to content

Commit 8ec2616

Browse files
committed
Disable stringsAsFactors during unit testing
1 parent 9e0a748 commit 8ec2616

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Many tests use hand-made reference data frames. In R < 4.0, columns like
2+
# `geo_values` and `data_source`, containing strings, are interpreted as
3+
# factors. To prevent us from having to set stringsAsFactors = FALSE in every
4+
# test case, set the option while saving the default to restore in the teardown
5+
# (in teardown-options.R).
6+
.defaultStringsAsFactors <- options(stringsAsFactors = FALSE)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# see setup-options.R
2+
options(stringsAsFactors = .defaultStringsAsFactors)

0 commit comments

Comments
 (0)