From 0a0ade27f062818428de65fd9f3ddedc31c62e98 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Tue, 24 Oct 2017 12:13:44 -0700 Subject: Allow disabling logging --- tests/conftest.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ac83eacf..dd860ff2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,13 +16,16 @@ from .util import _support # Perform logging by default; pytest will capture and thus hide it normally, -# presenting it on error/failure. -# Also make sure to set up timestamping for more sanity when debugging. -logging.basicConfig( - level=logging.DEBUG, - format="[%(relativeCreated)s]\t%(levelname)s:%(name)s:%(message)s", - datefmt="%H:%M:%S", -) +# presenting it on error/failure. (But also allow turning it off when doing +# very pinpoint debugging - e.g. using breakpoints, so you don't want output +# hiding enabled, but also don't want all the logging to gum up the terminal.) +if not os.environ.get('DISABLE_LOGGING', False): + logging.basicConfig( + level=logging.DEBUG, + # Also make sure to set up timestamping for more sanity when debugging. + format="[%(relativeCreated)s]\t%(levelname)s:%(name)s:%(message)s", + datefmt="%H:%M:%S", + ) def make_sftp_folder(): -- cgit v1.2.3