tests/testthat/setup-keyring.R

# Setup keyring for testing
if (requireNamespace("keyring", quietly = TRUE)) {
  # Set environment variables to use a non-interactive keyring backend
  # This prevents password prompts during testing
  if (!nzchar(Sys.getenv("KEYRING_BACKEND"))) {
    Sys.setenv("KEYRING_BACKEND" = "env")
  }
  
  # Alternatively, if env backend doesn't work, try file backend with empty password
  if (!nzchar(Sys.getenv("KEYRING_PASS"))) {
    Sys.setenv("KEYRING_PASS" = "")
  }
}

Try the RKorAPClient package in your browser

Any scripts or data that you put into this service are public.

RKorAPClient documentation built on Sept. 9, 2026, 5:11 p.m.