def pre_test_case(file_name, sub_dir): cmd = '' if 'Windows' == platform.system(): cmd = 'TASKKILL /IM chromedriver.exe /F' elif 'Darwin' == platform.system(): cmd = 'pkill chromedriver' try: p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p.wait() p.kill() finally: pass # set the system codec to 'utf-8' import sys reload(sys) sys.setdefaultencoding('utf8') test_logger.init(file_name, sub_dir)
# -*- coding: utf-8 -*- from com.ericsson.xn.commons import test_logger import Mod if __name__ == '__main__': test_logger.init('pm_main', 'pm') test_logger.info('This is info testing.') Mod.foo() test_logger.finish()