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

[R-package] [tests] remove uses of testthat::context() #4915

Merged
merged 3 commits into from
Dec 30, 2021

Conversation

jameslamb
Copy link
Collaborator

Older versions of {testthat} required the use of a function, testthat::context(), to separate tests in reporting output.

{testthat} has been moving away from requiring that, instead preferring to group tests results by test file name, the way pytest does.

From the testthat docs (link)

Use of context() is no longer recommended. Instead omit it, and messages will use the name of the file instead. This ensures that the context and test file name are always in sync.

And from the vignette describing {testthat} 3.x (link), which was first released in October 2020 (link)

context() is formally deprecated. testthat has been moving away from context() in favour of file names for quite some time, and now you'll be strongly encouraged remove these calls from your tests.

This PR proposes removing uses of context() in the R package's tests.

Notes for Reviewers

Contributes to #4862. Check the logs in the r-package MSVC tests to see what the new test logs look like (since those tests don't run R CMD check).

@jameslamb jameslamb changed the title [R-package] remove uses of testthat::context() in tests [R-package] [tests] remove uses of testthat::context() Dec 28, 2021
@jameslamb jameslamb marked this pull request as ready for review December 28, 2021 04:28
Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup!

@StrikerRUS
Copy link
Collaborator

Please resolve conflicts with master.

@jameslamb jameslamb merged commit a55ff18 into master Dec 30, 2021
@jameslamb jameslamb deleted the r/testthat-context branch December 30, 2021 03:13
@StrikerRUS StrikerRUS mentioned this pull request Jan 6, 2022
13 tasks
@jameslamb jameslamb mentioned this pull request Oct 7, 2022
40 tasks
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants