Closes #2990 Tests: Move data within testthat calls for test-derive_param_bsa.R#2991
Open
Closes #2990 Tests: Move data within testthat calls for test-derive_param_bsa.R#2991
Conversation
Co-authored-by: bms63 <10111024+bms63@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update tests to ensure data is within testthat calls
Closes #[issue] Tests: Move data within testthat calls for test-derive_param_bsa.R
Feb 27, 2026
Collaborator
|
@adcascone I made this with co-pilot. Do you mind reviewing? This one didn't have any data in it just the functions - which was interesting it caught that!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seven BSA formula helper functions in
tests/testthat/test-derive_param_bsa.Rwere defined at the top-level file scope, leaking into the global test environment and risking state spillover between tests. Each function is now scoped inside its correspondingtest_thatblock.Changes:
mosteller,dubois,haycock,gehan,boyd,fujimoto, andtakahirahelper functions from top-level scope into Tests 28–34 respectivelyBefore:
After:
Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.
Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the
mainbranch until you have checked off each task.styler::style_file()to style R and Rmd filesinst/cheatsheet/admiral_cheatsheet.pptxand re-upload a PDF and a PNG version of it to the same folder. (The PNG version can be created by taking a screenshot of the PDF version.) N/Adevtools::document()so all.Rdfiles in themanfolder and theNAMESPACEfile in the project root are updated appropriately. N/ANEWS.mdunder the header# admiral (development version)if the changes pertain to a user-facing function (i.e. it has an@exporttag) or documentation aimed at users (rather than developers). N/A — test-only changepkgdown::build_site()and check that all affected examples are displayed correctly and that all new functions occur on the "Reference" page. N/Alintr::lint_package(). N/AR CMD checklocally and address all errors and warnings -devtools::check()Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.