Make logger available during tests

If any tests exercise code paths that emit logs, a warning is
displayed:

  No handlers could be found for logger "jenkins_jobs.modules.NAME"

Set up a logger with default configuration in the base test
class.  Now any logs will be displayed on the console.

Change-Id: Ib36afd5d96ff8e7fed110b6bedb6e281aac584f8
This commit is contained in:
David Pursehouse 2014-04-11 17:37:42 +09:00
parent 08060a1037
commit b49d6a299b

View File

@ -18,6 +18,7 @@
# under the License.
import codecs
import logging
import os
import re
import doctest
@ -63,6 +64,8 @@ class BaseTestCase(object):
maxDiff = None # always dump text difference
longMessage = True # keep normal error message when providing our
logging.basicConfig()
def __read_content(self):
# Read XML content, assuming it is unicode encoded
xml_filepath = os.path.join(self.fixtures_path, self.xml_filename)