diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-10-24 12:13:44 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2018-09-17 14:45:59 -0700 |
commit | cf113f11ede2acd906f0b2a3a476b2a081922581 (patch) | |
tree | a5fbb750c69d3626e84738115933afefac6a9009 /tests | |
parent | 1d96c4ebbc94a919df147b513009f6eb3a5df712 (diff) |
Allow disabling logging
Diffstat (limited to 'tests')
-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(): |