Skip to content

Add announce_snapshot_file() to prevent unwanted auto-deletion - #1397

Merged
lionel- merged 2 commits into
masterfrom
announce-snapshot-file
Jun 15, 2021
Merged

lionel- merged 2 commits into
masterfrom
announce-snapshot-file

Conversation

@lionel-

@lionel- lionel- commented Jun 14, 2021 •

Copy link
Copy Markdown
Member

Part of #1393.

Used in r-lib/vdiffr#109 to prevent auto-deletion of snapshot files in case of unexpected errors and skips.

@lionel-
lionel- requested a review from hadley June 14, 2021 16:31
Comment thread R/snapshot-file.R
#' directory. However we want to preserve snapshot files when the R
#' code wasn't executed because of an unexpected error or because of a
#' [skip()]. Let testthat know about these files by calling
#' `announce_snapshot_file()` before `expect_snapshot_file()`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you should also add expect_snapshot_png() in the example below to show what a full wrapper will look like. Otherwise LGTM.

@lionel-
lionel- force-pushed the announce-snapshot-file branch from 1474d9b to eb2ef44 Compare June 15, 2021 09:11
@lionel-
lionel- merged commit 9d6db69 into master Jun 15, 2021
@lionel-
lionel- deleted the announce-snapshot-file branch June 15, 2021 09:20
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