Skip to content

Commit

Permalink
Fix/98 update log suppression (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAxthelm authored Oct 25, 2024
1 parent 92cacfa commit c07fd4c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 46 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: workflow.pacta
Title: Run PACTA
Version: 0.0.0.9011
Version: 0.0.0.9012
Authors@R:
c(person(given = "CJ",
family = "Yetman",
Expand Down
13 changes: 13 additions & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## save current settings so that we can reset later

## Logger Settings
# Set threshold to OFF, and capture previous state
logger_threshold <- logger::log_threshold("OFF")

## Tear down function
withr::defer(
expr = {
logger::log_threshold(logger_threshold)
},
envir = teardown_env()
)
15 changes: 0 additions & 15 deletions tests/testthat/test-analysis_prechecks.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
## save current settings so that we can reset later
threshold <- logger::log_threshold()
appender <- logger::log_appender()
layout <- logger::log_layout()
on.exit({
## reset logger settings
logger::log_threshold(threshold)
logger::log_layout(layout)
logger::log_appender(appender)
})

logger::log_appender(logger::appender_stdout)
logger::log_threshold(logger::FATAL)
logger::log_layout(logger::layout_simple)

test_that("audit_prechecks works when all files are present", {
pacta_data_dir <- withr::local_tempdir()
filenames <- c(
Expand Down
15 changes: 0 additions & 15 deletions tests/testthat/test-audit_prechecks.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
## save current settings so that we can reset later
threshold <- logger::log_threshold()
appender <- logger::log_appender()
layout <- logger::log_layout()
on.exit({
## reset logger settings
logger::log_threshold(threshold)
logger::log_layout(layout)
logger::log_appender(appender)
})

logger::log_appender(logger::appender_stdout)
logger::log_threshold(logger::FATAL)
logger::log_layout(logger::layout_simple)

test_that("audit_prechecks works when all files are present", {
pacta_data_dir <- withr::local_tempdir()
filenames <- c(
Expand Down
15 changes: 0 additions & 15 deletions tests/testthat/test-calc_weights_prechecks.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
## save current settings so that we can reset later
threshold <- logger::log_threshold()
appender <- logger::log_appender()
layout <- logger::log_layout()
on.exit({
## reset logger settings
logger::log_threshold(threshold)
logger::log_layout(layout)
logger::log_appender(appender)
})

logger::log_appender(logger::appender_stdout)
logger::log_threshold(logger::FATAL)
logger::log_layout(logger::layout_simple)

test_that("audit_prechecks works when all files are present", {
data_dir <- withr::local_tempdir()
filenames <- c(
Expand Down

0 comments on commit c07fd4c

Please sign in to comment.