Running ‘testthat.R’ [35s/84s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(weathercan)
  > 
  > Sys.setenv("R_TESTS" = "")
  > 
  > test_check("weathercan")
  ── 1. Error: tz_calc() returns the correct tz (@test_02_utils.R#21)  ───────────
  argument is of length zero
  1: expect_equal(tz_calc(lat = 49.246292, lon = -123.116226, etc = TRUE), "Etc/GMT+8") at testthat/test_02_utils.R:21
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: tz_calc(lat = 49.246292, lon = -123.116226, etc = TRUE)
  
  ── 2. Error: weather (hour) returns a data frame (@test_06_weather_dl.R#8)  ────
  argument is of length zero
  1: expect_message({
         w <- weather_dl(station_ids = 51423, start = "2014-01-01", end = "2014-01-31", 
             verbose = TRUE)
     }) at testthat/test_06_weather_dl.R:8
  2: quasi_capture(enquo(object), capture_messages, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: weather_dl(station_ids = 51423, start = "2014-01-01", end = "2014-01-31", verbose = TRUE) at testthat/test_06_weather_dl.R:8
  7: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  8: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 3. Error: weather (hour) formats timezone display (@test_06_weather_dl.R#34) 
  argument is of length zero
  1: expect_silent({
         w <- weather_dl(station_ids = 51423, start = "2014-03-01", end = "2014-04-01", 
             tz_disp = "America/Vancouver")
     }) at testthat/test_06_weather_dl.R:34
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: weather_dl(station_ids = 51423, start = "2014-03-01", end = "2014-04-01", tz_disp = "America/Vancouver") at testthat/test_06_weather_dl.R:34
  10: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  11: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 4. Error: weather (hour) formats timezone to UTC with multiple zones (@test_0
  argument is of length zero
  1: expect_silent({
         w <- weather_dl(c(42203, 49909), start = "2017-09-01", end = "2017-09-30")
     }) at testthat/test_06_weather_dl.R:44
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: weather_dl(c(42203, 49909), start = "2017-09-01", end = "2017-09-30") at testthat/test_06_weather_dl.R:44
  10: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  11: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 5. Error: weather (hour) gets all (@test_06_weather_dl.R#61)  ───────────────
  argument is of length zero
  1: expect_silent(w <- weather_dl(station_ids = 50821, start = "2018-01-01", end = "2018-01-02", 
         interval = "hour", trim = FALSE)) at testthat/test_06_weather_dl.R:61
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: weather_dl(station_ids = 50821, start = "2018-01-01", end = "2018-01-02", interval = "hour", 
         trim = FALSE)
  10: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  11: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 6. Error: weather (hour) trims NAs (@test_06_weather_dl.R#73)  ──────────────
  argument is of length zero
  1: expect_equal(nrow(weather_dl(6819, start = "2017-08-20", end = "2017-10-01", interval = "hour", 
         trim = TRUE)), 96) at testthat/test_06_weather_dl.R:73
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: nrow(weather_dl(6819, start = "2017-08-20", end = "2017-10-01", interval = "hour", 
         trim = TRUE))
  5: weather_dl(6819, start = "2017-08-20", end = "2017-10-01", interval = "hour", trim = TRUE)
  6: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  7: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 7. Error: weather (hour) multiple stations (@test_06_weather_dl.R#80)  ──────
  argument is of length zero
  1: expect_silent({
         w <- weather_dl(station_ids = c(51423, 50821), start = "2014-03-01", end = "2014-03-15")
     }) at testthat/test_06_weather_dl.R:80
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: weather_dl(station_ids = c(51423, 50821), start = "2014-03-01", end = "2014-03-15") at testthat/test_06_weather_dl.R:80
  10: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  11: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 8. Error: weather (hour) no data fails nicely (@test_06_weather_dl.R#109)  ──
  argument is of length zero
  1: expect_silent(expect_message(w0 <- weather_dl(1275, interval = "hour", start = "2017-01-01", 
         end = "2017-02-01"), paste0("There are no data for station 1275, ", "in this time range \\(2017-01-01 to 2017-02-01\\), ", 
         "for this interval \\(hour\\)"))) at testthat/test_06_weather_dl.R:109
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: expect_message(w0 <- weather_dl(1275, interval = "hour", start = "2017-01-01", end = "2017-02-01"), 
         paste0("There are no data for station 1275, ", "in this time range \\(2017-01-01 to 2017-02-01\\), ", 
             "for this interval \\(hour\\)"))
  10: quasi_capture(enquo(object), capture_messages, label = label)
  11: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  12: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  13: eval_bare(get_expr(quo), get_env(quo))
  14: weather_dl(1275, interval = "hour", start = "2017-01-01", end = "2017-02-01")
  15: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  16: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 9. Error: weather (hour) verbose and quiet (@test_06_weather_dl.R#134)  ─────
  argument is of length zero
  1: expect_message(weather_dl(c(1275, 1001), interval = "hour", start = "2017-01-01", 
         end = "2017-02-01")) at testthat/test_06_weather_dl.R:134
  2: quasi_capture(enquo(object), capture_messages, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: weather_dl(c(1275, 1001), interval = "hour", start = "2017-01-01", end = "2017-02-01")
  7: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  8: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 10. Error: weather (hour) handles data with different numbers of columns (@te
  argument is of length zero
  1: expect_silent(d <- weather_dl(station_ids = 51423, start = "2018-03-20", end = "2018-04-10")) at testthat/test_06_weather_dl.R:149
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: weather_dl(station_ids = 51423, start = "2018-03-20", end = "2018-04-10")
  10: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  11: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 11. Error: weather (hour) skips with message if end date < start date (@test_
  argument is of length zero
  1: expect_message({
         w <- weather_dl(c(42203, 49909), end = "2006-04-20")
     }, "End date earlier") at testthat/test_06_weather_dl.R:167
  2: quasi_capture(enquo(object), capture_messages, label = label)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(quo), get_env(quo))
  6: weather_dl(c(42203, 49909), end = "2006-04-20") at testthat/test_06_weather_dl.R:167
  7: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  8: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ── 12. Error: list_col=TRUE and interval=hour groups on the right level (@test_0
  argument is of length zero
  1: expect_equal(ncol(weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", 
         interval = "hour") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -date)), ncol(weather_dl(station_ids = c(51423), 
         start = "2018-04-01", end = "2018-04-15", interval = "hour", list_col = TRUE))) at testthat/test_06_weather_dl.R:513
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ncol(weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", 
         interval = "hour") %>% tidyr::nest(-dplyr::one_of(names(p_names)), -date))
  5: weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", interval = "hour") %>% 
         tidyr::nest(-dplyr::one_of(names(p_names)), -date)
  6: eval(lhs, parent, parent)
  7: eval(lhs, parent, parent)
  8: weather_dl(station_ids = c(51423), start = "2018-04-01", end = "2018-04-15", interval = "hour")
  9: weather_format(w = w, interval = interval, tz_disp = tz_disp, string_as = string_as, 
         quiet = quiet, preamble = preamble)
  10: tz_calc(coords = unique(preamble[, c("lat", "lon")]), etc = TRUE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 433 SKIPPED: 5 FAILED: 12
  1. Error: tz_calc() returns the correct tz (@test_02_utils.R#21) 
  2. Error: weather (hour) returns a data frame (@test_06_weather_dl.R#8) 
  3. Error: weather (hour) formats timezone display (@test_06_weather_dl.R#34) 
  4. Error: weather (hour) formats timezone to UTC with multiple zones (@test_06_weather_dl.R#44) 
  5. Error: weather (hour) gets all (@test_06_weather_dl.R#61) 
  6. Error: weather (hour) trims NAs (@test_06_weather_dl.R#73) 
  7. Error: weather (hour) multiple stations (@test_06_weather_dl.R#80) 
  8. Error: weather (hour) no data fails nicely (@test_06_weather_dl.R#109) 
  9. Error: weather (hour) verbose and quiet (@test_06_weather_dl.R#134) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted