# Path: tests/testing_utils.py
# def assert_no_logs(function):
#     """Decorator that asserts that nothing is logged in a function."""
#     @functools.wraps(function)
#     def wrapper(*args, **kwargs):
#         with capture_logs() as logs:
#             try:
#                 function(*args, **kwargs)
#             except Exception:  # pragma: no cover
#                 if logs:
#                     print(f'{len(logs)} errors logged:', file=sys.stderr)
#                     for message in logs:
#                         print(message, file=sys.stderr)
#                 raise
#             else:
#                 if logs:  # pragma: no cover
#                     for message in logs:
#                         print(message, file=sys.stderr)
#                     raise AssertionError(f'{len(logs)} errors logged')
#     return wrapper
# 
# def render_pages(html_content):
#     """Lay out a document and return a list of PageBox objects."""
#     return [
#         page._page_box for page in
#         FakeHTML(string=html_content, base_url=BASE_URL).render().pages]


import pytest
from ..testing_utils import assert_no_logs, render_pages
    body, = html.children
    div, = body.children
    assert div.width == 5
    columns = div.children
    assert len(columns) == 3
    assert [column.width for column in columns] == [1, 1, 1]
    assert [column.position_x for column in columns] == [0, 1, 2]
    assert [column.position_y for column in columns] == [0, 0, 0]


@assert_no_logs
def test_columns_empty():
    page, = render_pages('''
      <style>
        @font-face { src: url(weasyprint.otf); font-family: weasyprint }
        div { columns: 3 }
        body { margin: 0; font-family: weasyprint }
        @page { margin: 0; size: 3px; font-size: 1px }
      </style>
      <div></div>
    ''')
    html, = page.children
    body, = html.children
    div, = body.children
    assert div.width == 3
    assert div.height == 0
    columns = div.children
    assert len(columns) == 0



# Path: tests/testing_utils.py
# def assert_no_logs(function):
#     """Decorator that asserts that nothing is logged in a function."""
#     @functools.wraps(function)
#     def wrapper(*args, **kwargs):
#         with capture_logs() as logs:
#             try:
#                 function(*args, **kwargs)
#             except Exception:  # pragma: no cover
#                 if logs:
#                     print(f'{len(logs)} errors logged:', file=sys.stderr)
#                     for message in logs:
#                         print(message, file=sys.stderr)
#                 raise
#             else:
#                 if logs:  # pragma: no cover
#                     for message in logs:
#                         print(message, file=sys.stderr)
#                     raise AssertionError(f'{len(logs)} errors logged')
#     return wrapper
# 
# def render_pages(html_content):
#     """Lay out a document and return a list of PageBox objects."""
#     return [
#         page._page_box for page in
#         FakeHTML(string=html_content, base_url=BASE_URL).render().pages]


# Path: tests/layout/test_column.py
import pytest
from ..testing_utils import assert_no_logs, render_pages

    body, = html.children
    div, = body.children
    assert div.width == 5
    columns = div.children
    assert len(columns) == 3
    assert [column.width for column in columns] == [1, 1, 1]
    assert [column.position_x for column in columns] == [0, 1, 2]
    assert [column.position_y for column in columns] == [0, 0, 0]


@assert_no_logs
def test_columns_empty():
    page, = render_pages('''
      <style>
        @font-face { src: url(weasyprint.otf); font-family: weasyprint }
        div { columns: 3 }
        body { margin: 0; font-family: weasyprint }
        @page { margin: 0; size: 3px; font-size: 1px }
      </style>
      <div></div>
    ''')
    html, = page.children
    body, = html.children
    div, = body.children
    assert div.width == 3
    assert div.height == 0
    columns = div.children
    assert len(columns) == 0



@assert_no_logs