def spanning_dates(request, date_ranges):
    """Returns a pair of date ranges for a container object and a contained
    object, and a flag indicating whether the container date ranges completely
    spans the contained date range."""

    container_validity, contained_validity, container_spans_contained = request.param
    return (
        getattr(date_ranges, container_validity),
        getattr(date_ranges, contained_validity),
        container_spans_contained,
    )