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

v3.1.10: local_edition(3) doesn't work if readr is loaded #1877

Closed
torbjorn opened this issue Oct 4, 2023 · 1 comment
Closed

v3.1.10: local_edition(3) doesn't work if readr is loaded #1877

torbjorn opened this issue Oct 4, 2023 · 1 comment

Comments

@torbjorn
Copy link

torbjorn commented Oct 4, 2023

Consider the following minimal test script:

library(tidyverse)
print(search())

describe("setting edition with tidyverse loaded", {

    test_that( "TRUE is TRUE", {

        local_edition(3)
        expect_true(isTRUE(TRUE))

    })

})

Output:

> testthat::test_file("tests/testthat/test_testthat_issue.R")

══ Testing test_testthat_issue.R ═══════════════════════════════════════════════════════════════════════════════════════════════════════════
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 0 ] [1] ".GlobalEnv"        "package:forcats"   "package:stringr"  
 [4] "package:dplyr"     "package:purrr"     "package:readr"    
 [7] "package:tidyr"     "package:tibble"    "package:ggplot2"  
[10] "package:tidyverse" "package:testthat"  "package:stats"    
[13] "package:graphics"  "package:grDevices" "package:datasets" 
[16] "renv:shims"        "package:utils"     "package:methods"  
[19] "Autoloads"         "package:base"     
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]

── Error (test_testthat_issue.R:8:9): TRUE is TRUE ─────────────────────────────
Error in `edition_set(edition)`: edition %in% c(1L, 2L) is not TRUE
Backtrace:
    ▆
 1. └─readr::local_edition(3) at test_testthat_issue.R:8:8
 2.   └─readr:::edition_set(edition)
 3.     └─base::stopifnot(edition %in% c(1L, 2L))
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]

For some reason it ends up in readr:::edition_set

@torbjorn
Copy link
Author

torbjorn commented Oct 4, 2023

ah wait.

testthat::local_edition(3)

you can probably disregard this issue.

@torbjorn torbjorn closed this as completed Oct 4, 2023
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

No branches or pull requests

1 participant