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

Collect more reliable trace_env #2012

Merged
merged 7 commits into from
Nov 6, 2024
Merged

Collect more reliable trace_env #2012

merged 7 commits into from
Nov 6, 2024

Conversation

hadley
Copy link
Member

@hadley hadley commented Nov 5, 2024

And create more helpers for testing various more complicated success and failure modes.

Fixes #1994

@DavisVaughan no need to go deep here on the actual implementation/fix, but I'd appreciate your eyes on the newly exported expectation test helpers.

And create more helpers for testing various more complicated success and failure modes.

Fixes #1994
Copy link
Member

@DavisVaughan DavisVaughan left a comment

Choose a reason for hiding this comment

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

I don't really know when I'd ever use these in my own packages, but I am on board with the symmetry since you already have expect_success() and expect_failure()

NEWS.md Outdated Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
R/expect-self-test.R Outdated Show resolved Hide resolved
R/expect-self-test.R Outdated Show resolved Hide resolved
Comment on lines +83 to +84
expect_no_failure <- function(expr) {
exp <- capture_failure(expr)
Copy link
Member

@DavisVaughan DavisVaughan Nov 6, 2024

Choose a reason for hiding this comment

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

Maybe add a test? (i see you do have one for expect_no_success(), and existing ones for expect_snapshot_failure())

Copy link
Member Author

Choose a reason for hiding this comment

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

Like expect_failure(expect_no_failure(expect_true(FALSE)))? 😆

@hadley hadley merged commit 6ba4397 into main Nov 6, 2024
11 checks passed
@hadley hadley deleted the bad-traceback branch November 6, 2024 15:42
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.

rlang error with `... %>% expect_warning()
2 participants