Skip to content
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

Should check_installed() skip tests instead of error? #1658

Open
olivroy opened this issue Oct 12, 2023 · 2 comments
Open

Should check_installed() skip tests instead of error? #1658

olivroy opened this issue Oct 12, 2023 · 2 comments

Comments

@olivroy
Copy link
Contributor

olivroy commented Oct 12, 2023

If check_installed() is called in tests, we would get an error (non-interactive sessions)

But could there be an option to skip the test instead?

Thanks

Edit: I mean when one of the packages is not installed!

Example in cynkra/dm#2040 (comment)

@olivroy olivroy changed the title FR: Should check_installed() skip tests instead of error? Should check_installed() skip tests instead of error? Oct 12, 2023
@krlmlr
Copy link
Member

krlmlr commented Oct 18, 2023

How is that different from the behavior we have today?

@krlmlr
Copy link
Member

krlmlr commented Oct 18, 2023

Wrong repo 🤦

For context: in dm, we have a wrapper around check_installed() that first calls is_installed() and (only in tests) calls skip() with an appropriate error message. This means that we almost never need to call skip_if_not_installed() in tests. Because we also test with every weak dependency missing, in a matrix, this also checks for us if our user-facing code has appropriate checks.

https://github.com/cynkra/dm/blob/main/R/check_suggested.R

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants