Use with_reporter() internally#355
Merged
Merged
Conversation
added 2 commits
January 27, 2016 00:52
so that end_reporter() is called in one place only
| results <- lapply(paths, test_file, env = env, | ||
| reporter = current_reporter, start_end_reporter = FALSE) | ||
| current_reporter$end_reporter() | ||
| with_reporter( |
Member
There was a problem hiding this comment.
I think this would be clearer as results <- with_reporter(current_reporter, ...)
Member
Author
There was a problem hiding this comment.
with_reporter() returns the reporter, not the results of the code. At least one package (checkmate) depends on this behavior. I'll add documentation.
Member
|
Otherwise, looks good. |
Member
Author
|
Documentation added. |
Member
|
LGTM. Can you please add a news bullet and merge? |
krlmlr
added a commit
that referenced
this pull request
Feb 19, 2016
- `with_reporter()` is used internally and gains new argument `start_end_reporter = TRUE`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
for better control over the testing logic (e.g., stop if encountering any error: #308).
In the long run, I think the code that's now in test_file() should be vectorized to allow for several files (perhaps extract the logic to a new function test_file_one()). Then test_files() simply calls test_file().