view tests/conftest.py @ 142:0bdd938d6b9f

Better date/time handling for pages: - Date can be specified in the page config. - Fall back to timestamp 0 (which is fixed) instead of the timestamp of the file (which could vary). Sources can return additional config values to merge with the page's YAML front matter.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 29 Nov 2014 18:33:29 -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)