Skip to content

Fix condition expectations in prevision of testthat breaking change #236

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

Merged
merged 2 commits into from
Jun 17, 2021

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Jun 16, 2021

We are planning a breaking change to the condition expectations in testthat release (see NEWS item in r-lib/testthat#1401). This PR implements a preventive fix that works with and without the breaking change.

There is no hurry to get this fix on CRAN since we are skipping one released version of testthat before going through with the change.

@DavisVaughan DavisVaughan merged commit 2cda574 into master Jun 17, 2021
@DavisVaughan
Copy link
Member

Thanks!

@DavisVaughan DavisVaughan deleted the fix-testthat-breaking-change branch June 17, 2021 12:41
@lionel- lionel- mentioned this pull request Sep 20, 2021
43 tasks
@hadley
Copy link
Member

hadley commented Sep 20, 2021

We're planning on releasing to CRAN soon, so I'd really appreciate it if you could do a release so we avoid breaking a CRAN check for your package 😄

@DavisVaughan
Copy link
Member

Hmm this was included in 0.3.1 which was sent to CRAN awhile back. Is there a different issue?

Should I just run the clock checks with dev testthat?

@hadley
Copy link
Member

hadley commented Sep 20, 2021

Yeah, there must be a new issue. I saw this:

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure (test-zoned-time.R:399:3): %z must parse correctly if included ──────
expect_warning(...) (`actual`) not identical to `expect` (`expected`).

`actual` is length 2
`expected` is length 1

    class(actual)                  | class(expected)       
[1] "clock_warning_parse_failures" - "clock_zoned_time" [1]
[2] "clock_warning"                - "clock_rcrd"       [2]
[3] "warning"                      - "vctrs_rcrd"       [3]
[4] "condition"                    - "vctrs_vctr"       [4]

`names(actual)`:   "message" "trace"       
`names(expected)`: "ticks"   "ticks_of_day"

`attr(actual, 'precision')` is absent
`attr(expected, 'precision')` is an integer vector (7)

`attr(actual, 'zone')` is absent
`attr(expected, 'zone')` is a character vector ('America/New_York')

`actual$message` is a character vector ('Failed to parse 1 string at location 1. Returning `NA` at that location.')
`expected$message` is absent

`actual$trace` is an S3 object of class <rlang_trace>, a list
`expected$trace` is absent

`actual$ticks` is absent
`expected$ticks` is an integer vector (NA)

`actual$ticks_of_day` is absent
`expected$ticks_of_day` is an integer vector (NA)

[ FAIL 1 | WARN 0 | SKIP 221 | PASS 976 ]
Error: Test failures
Execution halted

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.

3 participants