From dbb1389254d0e791828414eb66382b4e408d6a5d Mon Sep 17 00:00:00 2001 From: James Woglom Date: Sat, 4 Dec 2021 21:18:53 -0500 Subject: [PATCH] hack: enable debug logging in tests --- tests/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..c68f6f5 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,10 @@ +# Hack to enable debug-level logging when running tests +# with `python3 -m unittest discover` + +import sys +if 'unittest' in sys.modules: + import logging + logging.basicConfig( + level=logging.DEBUG, + format='%(asctime)s %(levelname)-8s %(message)s', + datefmt='%Y-%m-%d %H:%M:%S')