fix py3 tests

This commit is contained in:
Daniel Wallace 2017-12-12 12:11:01 -07:00
parent dab4a8cff3
commit e2824a7253
No known key found for this signature in database
GPG Key ID: 5FA5E5544F010D48

View File

@ -33,6 +33,7 @@ from tests.support.xmlunit import HAS_XMLRUNNER, XMLTestRunner
# Import 3rd-party libs
import salt.ext.six as six
import salt.utils
try:
from tests.support.ext import console
WIDTH, HEIGHT = console.getTerminalSize()
@ -455,6 +456,10 @@ class SaltTestingParser(optparse.OptionParser):
logging_level = logging.INFO
else:
logging_level = logging.ERROR
if salt.utils.is_windows():
os.environ['TESTS_LOG_LEVEL'] = six.binary_type(self.options.verbosity)
else:
os.environ['TESTS_LOG_LEVEL'] = six.text_type(self.options.verbosity)
consolehandler.setLevel(logging_level)
logging.root.addHandler(consolehandler)
log.info('Runtests logging has been setup')