Skip to content

Commit

Permalink
Fix: Make logging levels consistent through execution of runtests.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan A. Jones authored and Bryan A. Jones committed Jun 30, 2015
1 parent 97f2273 commit e8a6fc8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from PyInstaller.lib import junitxml
from PyInstaller.utils import misc, winutils
from PyInstaller.cliutils import archive_viewer
import PyInstaller.log as logging

# HACK
PyInstaller.makespec._EXENAME_FORCED_SUFFIX_ = '.exe'
Expand Down Expand Up @@ -814,6 +815,20 @@ def main():
global VERBOSE, REPORT, PYI_CONFIG
VERBOSE = opts.verbose
REPORT = opts.junitxml is not None
# The function called by configure.get_config uses logging. So, we need to
# set a logging level now, in addition to passing it as a "log-level=XXXX"
# option in test_building (see the OPTS dict), in order for the logging
# level to be consistent. Otherwise, the default logging level of INFO will
# produce messages, then be overriden by runtest's default (when the -v /
# --verbose option isn't specificed on runtest's command line) of ERROR
# (again, see the OPTS dict in test_building).
if VERBOSE:
# logging's default of INFO is fine.
pass
else:
# Set the logging level to ERROR.
logger = logging.getLogger('PyInstaller')
logger.setLevel(logging.ERROR)
PYI_CONFIG = configure.get_config(upx_dir=None) # Run configure phase only once.


Expand Down

0 comments on commit e8a6fc8

Please sign in to comment.