pytest命令行执行默认不会打印log信息,需要加‘-s’参数或者 ‘–capture=no’,即pytest -s #! /usr/bin/env python # coding=gbk import logging, os class logger: def __init__(self, path, clevel=logging.DEBUG, Flevel=logging.DEBUG): self.logger = logging.getLogger(path) self.logger.s…