view tests/conftest.py @ 217:1f4c3dae1fe8

bake: Better error handling for site baking. The site baker now keeps track of whether any worker saw any error. It returns the current record after a bake. The `bake` command uses this return value to figure out what kind of exit code to return.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 31 Jan 2015 17:35:36 -0800
parents 1cd67680c38c
children 76c838453dbe
line wrap: on
line source

import sys
import logging


def pytest_runtest_setup(item):
    pass


def pytest_addoption(parser):
    parser.addoption('--log-debug', action='store_true',
            help="Sets the PieCrust logger to output debug info to stdout.")


def pytest_configure(config):
    if config.getoption('--log-debug'):
        hdl = logging.StreamHandler(stream=sys.stdout)
        logging.getLogger('piecrust').addHandler(hdl)
        logging.getLogger('piecrust').setLevel(logging.DEBUG)