-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use future in package with testthat if package isn't pre-installed #742
Comments
Whilst trying to find a workaround for this I came across some additional weird behaviour (happy to make a new issue if needed) A viable workaround seems to be just force the execution of
I was concerned though this might not accurately represent real behaviour though as
|
Some additional weird behaviour even outside of the testthat setup:
Whats weird is if insert
|
Apologies in advance I feel this is such a common use case that I must be doing something wrong but I've tried reading as many relevant docs / issues as I can find and am unable to see a solution.
Simply put, if you create & evaluate a future within a package then it will throw an error if the package isn't installed. This mainly comes up with testing a package via testthat particularly in CICD pipelines. As a minimal example:
Then when running testthat:
Expected behavior
I'm not really sure what the correct behaviour here should be.. Potentially an option to force futures to grab objects from within the package instead of trying to load the package which can be toggled on during testing environments ?
Session information
Please share your session information after the error has occurred so that we also see which packages and versions are involved;
The text was updated successfully, but these errors were encountered: