Running 'testthat.R' [16s/27s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(tidyquant)
  Loading required package: lubridate
  
  Attaching package: 'lubridate'
  
  The following objects are masked from 'package:base':
  
      date, intersect, setdiff, union
  
  Loading required package: PerformanceAnalytics
  Loading required package: xts
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  
  Attaching package: 'PerformanceAnalytics'
  
  The following object is masked from 'package:graphics':
  
      legend
  
  Loading required package: quantmod
  Loading required package: TTR
  Version 0.4-0 included new data defaults. See ?getSymbols.
  == Need to Learn tidyquant? ====================================================
  Business Science offers a 1-hour course - Learning Lab #9: Performance Analysis & Portfolio Optimization with tidyquant!
  </> Learn more at: https://university.business-science.io/p/learning-labs-pro </>
  > library(tidyverse)
  -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
  v ggplot2 3.3.0     v purrr   0.3.4
  v tibble  3.0.1     v dplyr   0.8.5
  v tidyr   1.0.3     v stringr 1.4.0
  v readr   1.3.1     v forcats 0.5.0
  -- Conflicts ------------------------------------------ tidyverse_conflicts() --
  x lubridate::as.difftime() masks base::as.difftime()
  x lubridate::date()        masks base::date()
  x dplyr::filter()          masks stats::filter()
  x dplyr::first()           masks xts::first()
  x lubridate::intersect()   masks base::intersect()
  x purrr::is_null()         masks testthat::is_null()
  x dplyr::lag()             masks stats::lag()
  x dplyr::last()            masks xts::last()
  x dplyr::matches()         masks tidyr::matches(), testthat::matches()
  x lubridate::setdiff()     masks base::setdiff()
  x lubridate::union()       masks base::union()
  > library(dplyr)
  > library(tibble)
  > 
  > test_check("tidyquant")
  -- 1. Error: (unknown) (@test-tq_portfolio.R#31)  ------------------------------
  'where' must be an environment
  Backtrace:
    1. tidyquant::tq_portfolio(...)
    3. tidyquant:::tq_portfolio_.grouped_df(...)
    5. tidyquant:::tq_portfolio_.tbl_df(...)
    6. tidyquant:::tq_portfolio_base_(...)
    7. base::tryCatch(...)
    8. base:::tryCatchList(expr, classes, parentenv, handlers)
    9. base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   10. value[[3L]](cond)
  
  == testthat results  ===========================================================
  [ OK: 95 | SKIPPED: 2 | WARNINGS: 0 | FAILED: 1 ]
  1. Error: (unknown) (@test-tq_portfolio.R#31) 
  
  Error: testthat unit tests failed
  In addition: Warning messages:
  1: In UseMethod("mean") :
    closing unused connection 10 (https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1262304000&period2=1420070400&interval=1d&events=history&crumb=vfkIJc9JE.8)
  2: In UseMethod("mean") :
    closing unused connection 9 (https://query2.finance.yahoo.com/v7/finance/download/XYZ?period1=1262304000&period2=1589155200&interval=1d&events=history&crumb=vfkIJc9JE.8)
  3: In UseMethod("mean") :
    closing unused connection 8 (https://query2.finance.yahoo.com/v7/finance/download/XYZ?period1=1262304000&period2=1589155200&interval=1d&events=history&crumb=I4sF4hUFZdw)
  4: In UseMethod("mean") :
    closing unused connection 7 (https://query2.finance.yahoo.com/v7/finance/download/XYZ?period1=1262304000&period2=1589155200&interval=1d&events=history&crumb=I4sF4hUFZdw)
  5: In UseMethod("mean") :
    closing unused connection 6 (https://query1.finance.yahoo.com/v7/finance/download/XYZ?period1=1262304000&period2=1589155200&interval=1d&events=history&crumb=kjatRDEq1o3)
  6: In UseMethod("mean") :
    closing unused connection 5 (https://fred.stlouisfed.org/series/XYZ/downloaddata/XYZ.csv)
  7: In UseMethod("mean") :
    closing unused connection 4 (https://fred.stlouisfed.org/series/XYZ/downloaddata/XYZ.csv)
  Execution halted