Skip to content

Unify as.data.frame structure for empty testthat_results#887

Merged
hadley merged 1 commit into
r-lib:masterfrom
jozefhajnala:empty-test-result-df
Jul 16, 2019
Merged

Unify as.data.frame structure for empty testthat_results#887
hadley merged 1 commit into
r-lib:masterfrom
jozefhajnala:empty-test-result-df

Conversation

@jozefhajnala
Copy link
Copy Markdown
Contributor

This PR proposes to unify the "return type" of as.data.frame.testthat_results() to a data frame with 13 columns with predefined names, regardless of whether the input object is of length 0.

Context and motivation

I often use testthat results in a CI context, where combining (i.e. rbinding) the results of tests for multiple packages into 1 data frame is quite useful. It happens sometimes that one of those objects is empty, in which case as.data.frame(testResults) returns a 0 x 0 data frame, requiring further manipulation if we want to apply unified methods.

Copy link
Copy Markdown
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

Can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

@hadley hadley merged commit f748870 into r-lib:master Jul 16, 2019
@hadley
Copy link
Copy Markdown
Member

hadley commented Jul 16, 2019

Thanks!

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.

2 participants