diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-10-24 12:13:44 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-10-24 12:13:44 -0700 |
commit | 0a0ade27f062818428de65fd9f3ddedc31c62e98 (patch) | |
tree | bbf0fab0a375a91217ce44ccea7510b554cd76c9 | |
parent | ca1df7477d8178b2680f09c8e5d63cd94483535b (diff) |
Allow disabling logging
-rw-r--r-- | tests/conftest.py | 17 |
1 files 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(): |