def isolate_logging()

in conftest.py [0:0]


def isolate_logging():
    "Ensure any changes to logging are isolated to individual tests" ""
    try:
        yield
    finally:
        sys.stdout = sys.__stdout__
        sys.stderr = sys.__stderr__
        logging.shutdown()
        reload(logging)