Skip to content

Commit 5e4e121

Browse files
committed
Set logging level to DEBUG during test setup
Moved the logging level configuration into the `pytest_runtest_setup` function to ensure consistent logging behavior during test execution. This ensures debug logs are enabled only when tests are run.
1 parent a9e9664 commit 5e4e121

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
BACKENDS = ["jax", "numpy", "tensorflow", "torch"]
77

8-
logging.getLogger("bayesflow").setLevel(logging.DEBUG)
9-
108

119
def pytest_runtest_setup(item):
1210
"""Skips backends by test markers. Unmarked tests are treated as backend-agnostic"""
@@ -28,6 +26,9 @@ def pytest_runtest_setup(item):
2826
# use a non-GUI plotting backend for tests
2927
matplotlib.use("Agg")
3028

29+
# set the logging level to debug for all tests
30+
logging.getLogger("bayesflow").setLevel(logging.DEBUG)
31+
3132

3233
def pytest_runtest_teardown(item, nextitem):
3334
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)