Skip to content

Conversation

@hadley
Copy link
Member

@hadley hadley commented Mar 29, 2023

And generally improve code, tests, and docs. Closes #1756. Fixes #1562.

And generally improve code, tests, and docs. Closes #1756. Fixes #1562.
@hadley hadley requested a review from DavisVaughan March 29, 2023 19:58
file.path(...)
}
base <- NULL
} else if (pkgload::is_loading()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you supply the name of the package being tested as pkg here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary, since it'll be pretty rare that multiple are being loaded at the same time.

R/test-path.R Outdated

if (!dir.exists(base)) {
abort("Can't find `tests/testthat/` in current directory.")
cli::cli_abort("Can find {.path {base}}.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another example of r-lib/cli#587 where we show a .path fragment that doesn't actually exist, but it will seem clickable.

@hadley hadley merged commit 4588502 into main Apr 5, 2023
@hadley hadley deleted the test-path-helper branch April 5, 2023 19:05
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

Successfully merging this pull request may close these issues.

Is calling test_path() at a global level within a helper-*.R file not supported?

3 participants