Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

Removes the custom skip_if_no_R4() helper and all R version skip checks from tests, as they are redundant given that the package already requires R >= 4.1.0 in DESCRIPTION.

Changes

  • Removed custom skip_if_no_R4() function definition (6 lines)
  • Removed 12 redundant R version skip checks
# Before
skip_if_no_R4 <- function() {
  if (R.Version()$major < 4) {
    skip("R 4.0.0 or newer not available for testing")
  }
}

test_that("dbplyr generic scalars translated correctly", {
  skip_if_no_R4()
  skip_if_not_installed("dbplyr")
  # ...
})

# After
test_that("dbplyr generic scalars translated correctly", {
  skip_if_not_installed("dbplyr")
  # ...
})

All changes are in tests/testthat/test-backend-dbplyr__duckdb_connection.R.

Since the package DESCRIPTION specifies R (>= 4.1.0) as a dependency, these version checks are unnecessary and have been removed to simplify the test code.

Original prompt

This section details on the original issue you should resolve

<issue_title>Uses skip_unless_r_version?</issue_title>
<issue_description>

{testthat} 3.3.0 ships testthat::skip_unless_r() as a shorthand that would obviate this helper. Would you like a PR doing so?</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Refactor test cases to use skip_unless_r Replace custom skip_if_no_R4 with testthat::skip_unless_r Dec 7, 2025
Copilot AI requested a review from krlmlr December 7, 2025 07:30
@krlmlr
Copy link
Collaborator

krlmlr commented Dec 7, 2025

@copilot: We require R >= 4.1.0 in DESCRIPTION, remove all skips.

Copy link
Contributor Author

Copilot AI commented Dec 7, 2025

@copilot: We require R >= 4.1.0 in DESCRIPTION, remove all skips.

Done. Removed all R version skips in commit fe0e570.

Copilot AI changed the title Replace custom skip_if_no_R4 with testthat::skip_unless_r Remove redundant R version checks from tests Dec 7, 2025
@krlmlr krlmlr marked this pull request as ready for review December 7, 2025 10:01
Copilot AI review requested due to automatic review settings December 7, 2025 10:01
@krlmlr krlmlr changed the title Remove redundant R version checks from tests test: Remove redundant R version checks from tests Dec 7, 2025
@krlmlr krlmlr enabled auto-merge (squash) December 7, 2025 10:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes redundant R version checking logic from the test suite. Since the package DESCRIPTION already requires R (>= 4.1.0), the custom skip_if_no_R4() helper function and all its calls are unnecessary - tests will never run on R versions below 4.1.0.

  • Removed the skip_if_no_R4() helper function definition (6 lines)
  • Removed 12 calls to skip_if_no_R4() from test cases

@krlmlr krlmlr merged commit b100a15 into main Dec 7, 2025
12 of 16 checks passed
@krlmlr krlmlr deleted the copilot/refactor-skip-helper-function branch December 7, 2025 10:11
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.

Uses skip_unless_r_version?

2 participants