testthat doesn't execute code in the global environment, but (I think) code executed by the multiverse looks for its variables in the global environment? (is that right?). This is why your test_dfs aren't found when executed by testthat, but are found if you happened to define them in advance in the global environment.
There's a bigger potential issue here of just what should the parent environment to the multiverse environments be (maybe where the multiverse is first created, if that's possible?). Should to open an issue to keep track of that question.
In the meantime, the hackish solution is to just use <<- to write the test_dfs into the global environment when running tests, and we can revisit later if we decide to change the parent environment for the universe environments.
testthat
doesn't execute code in the global environment, but (I think) code executed by the multiverse looks for its variables in the global environment? (is that right?). This is why yourtest_df
s aren't found when executed by testthat, but are found if you happened to define them in advance in the global environment.There's a bigger potential issue here of just what should the parent environment to the multiverse environments be (maybe where the multiverse is first created, if that's possible?). Should to open an issue to keep track of that question.
In the meantime, the hackish solution is to just use
<<-
to write thetest_df
s into the global environment when running tests, and we can revisit later if we decide to change the parent environment for the universe environments.