Running ‘testthat.R’ [2s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(pivot)
  > library(dbplyr)
  > library(dplyr)
  
  Attaching package: 'dplyr'
  
  The following objects are masked from 'package:dbplyr':
  
      ident, sql
  
  The following object is masked from 'package:testthat':
  
      matches
  
  The following objects are masked from 'package:stats':
  
      filter, lag
  
  The following objects are masked from 'package:base':
  
      intersect, setdiff, setequal, union
  
  > 
  > test_check("pivot")
  ── 1. Error: PIVOT construction (@test-pivot.R#44)  ────────────────────────────
  `con` must not be NULL
  1: sql_render(wide) at testthat/test-pivot.R:44
  2: sql_render.tbl_lazy(wide)
  3: sql_render(query$ops, con = con, ..., bare_identifier_ok = bare_identifier_ok)
  4: sql_render.op(query$ops, con = con, ..., bare_identifier_ok = bare_identifier_ok)
  5: sql_render(qry, con = con, ..., bare_identifier_ok = bare_identifier_ok)
  6: sql_render.pivot_query(qry, con = con, ..., bare_identifier_ok = bare_identifier_ok)
  7: sql_pivot(con = con, from = query$from, select = query$select, key = query$key, value = query$value, 
         levels = query$levels, fill = query$fill)
  8: `sql_pivot.Microsoft SQL Server`(con = con, from = query$from, select = query$select, 
         key = query$key, value = query$value, levels = query$levels, fill = query$fill)
  9: sql_pivot_MSSQLServer(...)
  10: escape(levels, collapse = NULL)
  11: stop("`con` must not be NULL", call. = FALSE)
  
  ── 2. Error: PIVOT warnings and errors (@test-pivot.R#71)  ─────────────────────
  `con` must not be NULL
  1: expect_warning({
         sql_pivot_MSSQLServer(con, ident("##test"), ident(), ident("Key"), quo(Value), 
             ident(c("a", "b", "c")), ident("Key"), fill = 0L)
     }, "Microsoft SQL Server Pivot Query requires an aggregate function.") at testthat/test-pivot.R:71
  2: quasi_capture(enquo(object), label, capture_warnings)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: sql_pivot_MSSQLServer(con, ident("##test"), ident(), ident("Key"), quo(Value), ident(c("a", 
         "b", "c")), ident("Key"), fill = 0L) at testthat/test-pivot.R:72
  7: dbplyr::sql(rlang::set_names(nm = ifelse(rlang::have_name(levels), names(levels), 
         unclass(levels)), purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", 
         dbplyr::sql(.), ",", fill, ")")) %>% rlang::set_names(levels)))
  8: c_character(...)
  9: rlang::set_names(nm = ifelse(rlang::have_name(levels), names(levels), unclass(levels)), 
         purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", dbplyr::sql(.), 
             ",", fill, ")")) %>% rlang::set_names(levels))
  10: set_names_impl(x, x, nm, ...)
  11: is_vector(x)
  12: purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", dbplyr::sql(.), 
         ",", fill, ")")) %>% rlang::set_names(levels)
  13: eval(lhs, parent, parent)
  14: eval(lhs, parent, parent)
  15: purrr::map_chr(escape(levels, collapse = NULL), ~build_sql("ISNULL(", dbplyr::sql(.), 
         ",", fill, ")"))
  16: escape(levels, collapse = NULL)
  17: stop("`con` must not be NULL", call. = FALSE)
  
  ── 3. Error: spread.tbl_lazy (@test-tidyr.R#8)  ────────────────────────────────
  `list(Species = Species, Variable = ~Variable, Value = Value)` must evaluate to column positions or names, not a list
  1: spread(lazy.long, Species, mean(Value)) at testthat/test-tidyr.R:8
  2: spread.tbl_lazy(lazy.long, Species, mean(Value))
  3: data %>% dplyr::group_by_(.dots = tidyselect::vars_select(dplyr::tbl_vars(data), 
         tidyselect::everything(), .exclude = c(dplyr::select_var(dplyr::tbl_vars(data), 
             !!key), all_names(value)))) %>% pivot(!!key, !!value, tidyselect::everything(), 
         fill = fill)
  4: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  5: eval(quote(`_fseq`(`_lhs`)), env, env)
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: `_fseq`(`_lhs`)
  8: freduce(value, `_function_list`)
  9: withVisible(function_list[[k]](value))
  10: function_list[[k]](value)
  ...
  34: apply_op(op$x)
  35: apply_op.op(op$x)
  36: eval(e, envir = environment())
  37: eval(e, envir = environment())
  38: FUN(.data, vars = list(Species = Species, Variable = ~Variable, Value = Value))
  39: select.data.frame(.data, vars = list(Species = Species, Variable = ~Variable, Value = Value))
  40: tidyselect::vars_select(sel_vars(.data), !!!quos(...))
  41: bad_calls(bad, "must evaluate to { singular(.vars) } positions or names, \\\n       not { first_type }")
  42: glubort(fmt_calls(calls), ..., .envir = .envir)
  43: .abort(text)
  
  ── 4. Failure: UNPIVOT construction (@test-unpivot.R#45)  ──────────────────────
  `query` not equal to sql(...).
  1/1 mismatches
  x[1]: "SELECT `Species`, `Variable`, `Value`\nFROM \"##iris\"\nUNPIVOT\n    (\"V
  x[1]: alue\" FOR \"Variable\" IN\n        (\"Sepal.Length\", \"Sepal.Width\", \"
  x[1]: Petal.Length\", \"Petal.Width\")\n    ) AS \"Value\""
  y[1]: "SELECT \"Species\", \"Variable\", \"Value\"\nFROM \"##iris\"\nUNPIVOT\n  
  y[1]:   (\"Value\" FOR \"Variable\" IN\n        (\"Sepal.Length\", \"Sepal.Width
  y[1]: \", \"Petal.Length\", \"Petal.Width\")\n    ) AS \"Value\""
  
  ── 5. Failure: order_by (@test-unpivot.R#81)  ──────────────────────────────────
  `sql` not identical to sql(...).
  1/1 mismatches
  x[1]: "SELECT `Variable`, `Key`, `Value`\nFROM \"my_table\"\nUNPIVOT\n    (\"Val
  x[1]: ue\" FOR \"Key\" IN\n        (\"a\", \"b\", \"c\")\n    ) AS \"Value\"\nOR
  x[1]: DER BY \"Key\", \"Variable\""
  y[1]: "SELECT \"Variable\", \"Key\", \"Value\"\nFROM \"my_table\"\nUNPIVOT\n    
  y[1]: (\"Value\" FOR \"Key\" IN\n        (\"a\", \"b\", \"c\")\n    ) AS \"Value
  y[1]: \"\nORDER BY \"Key\", \"Variable\""
  
  ── 6. Failure: find_connection (@test-utils.R#11)  ─────────────────────────────
  find_connection(lazy.long) not identical to `con`.
  names for target but not for current
  Attributes: < Component "class": 3 string mismatches >
  Length mismatch: comparison on first 0 components
  
  ── 7. Failure: find_connection (@test-utils.R#12)  ─────────────────────────────
  find_connection(grouped) not identical to `con`.
  names for target but not for current
  Attributes: < Component "class": 3 string mismatches >
  Length mismatch: comparison on first 0 components
  
  ── 8. Error: get_pivot_levels (@test-utils.R#29)  ──────────────────────────────
  `list(Species = Species)` must evaluate to column positions or names, not a list
  1: expect_identical(lazy.iris %>% select(Species) %>% distinct() %>% apply_op, iris %>% 
         select(Species) %>% distinct()) at testthat/test-utils.R:29
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: lazy.iris %>% select(Species) %>% distinct() %>% apply_op
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: withVisible(function_list[[k]](value))
  ...
  16: apply_op(op$x)
  17: apply_op.op(op$x)
  18: eval(e, envir = environment())
  19: eval(e, envir = environment())
  20: FUN(.data, vars = list(Species = Species))
  21: select.data.frame(.data, vars = list(Species = Species))
  22: tidyselect::vars_select(sel_vars(.data), !!!quos(...))
  23: bad_calls(bad, "must evaluate to { singular(.vars) } positions or names, \\\n       not { first_type }")
  24: glubort(fmt_calls(calls), ..., .envir = .envir)
  25: .abort(text)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 61 SKIPPED: 1 WARNINGS: 4 FAILED: 8
  1. Error: PIVOT construction (@test-pivot.R#44) 
  2. Error: PIVOT warnings and errors (@test-pivot.R#71) 
  3. Error: spread.tbl_lazy (@test-tidyr.R#8) 
  4. Failure: UNPIVOT construction (@test-unpivot.R#45) 
  5. Failure: order_by (@test-unpivot.R#81) 
  6. Failure: find_connection (@test-utils.R#11) 
  7. Failure: find_connection (@test-utils.R#12) 
  8. Error: get_pivot_levels (@test-utils.R#29) 
  
  Error: testthat unit tests failed
  Execution halted