Fix testthat warnings
Closed this issue · 0 comments
judith-bourque commented
Issue
3 warnings occur when running devtools::test()
:
✔ | 1 0 | analysis
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Warning (test-analysis.R:15:1): (code run outside of `test_that()`)
`context()` was deprecated in the 3rd edition.
Backtrace:
1. testthat::context("Biased samples")
at test-analysis.R:15:0
2. testthat:::edition_deprecate(3, "context()")
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ | 1 19 | Biased samples [0.3s]
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Warning (test-analysis.R:92:1): (code run outside of `test_that()`)
`context()` was deprecated in the 3rd edition.
Backtrace:
1. testthat::context("Calculate Proportions")
at test-analysis.R:92:0
2. testthat:::edition_deprecate(3, "context()")
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔ | 1 6 | Calculate Proportions
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Warning (test-analysis.R:117:1): (code run outside of `test_that()`)
`context()` was deprecated in the 3rd edition.
Backtrace:
1. testthat::context("Run dictionary analysis")
at test-analysis.R:117:0
2. testthat:::edition_deprecate(3, "context()")
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⠏ | 0 | Run dictionary analysis 100% expressions/words found
0.278 sec elapsed
⠋ | 1 | Run dictionary analysis 100% expressions/words found
0.262 sec elapsed
⠙ | 2 | Run dictionary analysis 100% expressions/words found
0.249 sec elapsed
⠹ | 3 | Run dictionary analysis 100% expressions/words found
0.252 sec elapsed
⠸ | 4 | Run dictionary analysis 100% expressions/words found
0.021 sec elapsed
✔ | 7 | Run dictionary analysis [1.1s]
✔ | 19 | dev_t
✔ | 2 | domestication
✔ | 6 | transform
══ Results ════════════════════════════════════════════════════════════════════════════════════════════════════════
Duration: 2.0 s
[ FAIL 0 | WARN 3 | SKIP 0 | PASS 59 ]
Proposed solution
- Fix context in test-analysis.R