I am trying to use xmlrunner to generate a xml of my test result with unittest. I would like the report to include my logging output. But it looks like it doesn't work.
For example, in this code, the logging output is not showing in the xml report.
import unittest
import logging
import xmlrunner
import sys
class Test(unittest.TestCase):
@classmethod
def setUpClass(cls):
logging.getLogger().debug("setUpClass")
def test_step_001(self):
logging.getLogger().debug("test_step_001")
@classmethod
def tearDownClass(cls):
logging.getLogger().debug("tearDownClass")
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s", stream=sys.stdout)
unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))