view tests/conftest.py @ 317:6c5de6edacf7

internal: Be more forgiving about building `Taxonomy` objects. Add `setting_name`. The setting name of a taxonomy is whatever name is used to assign terms of that taxonomy to a page. If the taxonomy is "multiple", this is the name of the taxonomy. If not, it's the term name (a singular name).
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 28 Mar 2015 14:17:50 -0700
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)