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:
parent
08060a1037
commit
b49d6a299b
@ -18,6 +18,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import doctest
|
import doctest
|
||||||
@ -63,6 +64,8 @@ class BaseTestCase(object):
|
|||||||
maxDiff = None # always dump text difference
|
maxDiff = None # always dump text difference
|
||||||
longMessage = True # keep normal error message when providing our
|
longMessage = True # keep normal error message when providing our
|
||||||
|
|
||||||
|
logging.basicConfig()
|
||||||
|
|
||||||
def __read_content(self):
|
def __read_content(self):
|
||||||
# Read XML content, assuming it is unicode encoded
|
# Read XML content, assuming it is unicode encoded
|
||||||
xml_filepath = os.path.join(self.fixtures_path, self.xml_filename)
|
xml_filepath = os.path.join(self.fixtures_path, self.xml_filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user