Skip to content

Use testthat edition 3 & fix imports - #246

Open
steffilazerte wants to merge 31 commits into
mainfrom
steffi-testthat3
Open

Use testthat edition 3 & fix imports#246
steffilazerte wants to merge 31 commits into
mainfrom
steffi-testthat3

Conversation

@steffilazerte

@steffilazerte steffilazerte commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Pull Request - Ready for review

Checklist

  • I have added tests to prove my changes work
  • I have added documentation where required
  • I have updated NEWS.md with a short description of my change

@steffilazerte

Copy link
Copy Markdown
Collaborator Author

Hi @sangeetabhatia03, sorry for the delay on this! I've updated the tests to testthat edition 3 which was pretty straightforward, and then added some snapshot tests, especially for the gibs draws functions (which was not too bad but a tad more complicated because of the custom snapshot tests and trying to avoid problems with randomization across different OS). I also added a snapshot test for the Wallinga Teunis function which fails on devel because they changed a randomization procedure. I'm skipping that test on devel for now, but once R updates we'll probably have to update the snapshot, but that seems like a later problem?

The linters are failing because I fixed a warning in plot.R but did not fix all the lint problems there (I think better to do that in a dedicated PR and I should have resisted the urge to fix the warning, but ah well).

I think it's good to go now. Once you've had a look, we can merge into main, and then I think you could merge main into #244, possibly refactor the tests to match the new functions you've created, but I think it shouldn't be strictly necessary (I'm happy to do that if needed). Then we should be able to merge #244 🎉 (I've taken a look and as far as I can tell it's good, but with so many changes it can't hurt to have the tests).

@steffilazerte steffilazerte changed the title Use testthat edition 3 Use testthat edition 3 & fix imports Jun 17, 2026
@sangeetabhatia03

Copy link
Copy Markdown
Collaborator

hi @steffilazerte I have added some minor comments; these changes will trigger a build failure with an older version of testthat. e.g. I get the following error:

 ── Error ('test-gibs_draws.R:39:3'): get_shape_R_flat() ────────────────────────
Error in `expect_all_equal(expect_silent(get_shape_R_flat(incid, default_priors())), 
    20.04)`: could not find function "expect_all_equal"
── Failure ('test-weekly.R:686:3'): you can't run estimate_R_agg unless using parametric/non-parametric SI methods ──

when testing with v3.1.7. So we either modify the offending function, or update the DESCRIPTION file.

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