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::expect_is() #4916

Merged
merged 1 commit into from
Dec 29, 2021

Conversation

jameslamb
Copy link
Collaborator

Similar to #4915, this PR proposes removing {lightgbm}'s use of a {testthat} function that is currently deprecated.

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

expect_is() is deprecated in favour of the more specific expect_type(), expect_s3_class(), and expect_s4_class().
This ensures that you check the expected class along with the expected OO system.

This PR proposes removing uses of expect_is() in the R package's tests. It proposes replacing them with expect_true(methods::is()) instead of the newest {testthat} because those 3 methods can't be used to test the class of an R6 object.

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 updates!

@StrikerRUS StrikerRUS changed the title [R-package] [tests] remove uses of testthat::expect_is() [R-package][tests] remove uses of testthat::expect_is() Dec 29, 2021
@StrikerRUS StrikerRUS merged commit f9053ab into master Dec 29, 2021
@StrikerRUS StrikerRUS deleted the r/testthat-expect-is branch December 29, 2021 23:27
@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