# 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]


from ..testing_utils import assert_no_logs, render_pages
      <ul class="fixed" style="right: 0"><li>a</li></ul>
      <img class="fixed" style="right: 20px" src="pattern.png" />
      <div class="fixed" style="right: 40px">b</div>
      <article>page1</article>
      <article>page2</article>
    ''')

    html, = page_1.children
    body, = html.children
    ul, img, div, article = body.children
    marker = ul.children[0]
    assert (ul.position_x, ul.position_y) == (80, 10)
    assert (img.position_x, img.position_y) == (60, 10)
    assert (div.position_x, div.position_y) == (40, 10)
    assert (article.position_x, article.position_y) == (0, 0)
    assert marker.position_x == ul.position_x

    html, = page_2.children
    ul, img, div, body = html.children
    marker = ul.children[0]
    assert (ul.position_x, ul.position_y) == (180, 10)
    assert (img.position_x, img.position_y) == (160, 10)
    assert (div.position_x, div.position_y) == (140, 10)
    assert (article.position_x, article.position_y) == (0, 0)
    assert marker.position_x == ul.position_x


@assert_no_logs
def test_fixed_positioning_regression_2():
    # Regression test for https://github.com/Kozea/WeasyPrint/issues/728

# 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_position.py
from ..testing_utils import assert_no_logs, render_pages

      <ul class="fixed" style="right: 0"><li>a</li></ul>
      <img class="fixed" style="right: 20px" src="pattern.png" />
      <div class="fixed" style="right: 40px">b</div>
      <article>page1</article>
      <article>page2</article>
    ''')

    html, = page_1.children
    body, = html.children
    ul, img, div, article = body.children
    marker = ul.children[0]
    assert (ul.position_x, ul.position_y) == (80, 10)
    assert (img.position_x, img.position_y) == (60, 10)
    assert (div.position_x, div.position_y) == (40, 10)
    assert (article.position_x, article.position_y) == (0, 0)
    assert marker.position_x == ul.position_x

    html, = page_2.children
    ul, img, div, body = html.children
    marker = ul.children[0]
    assert (ul.position_x, ul.position_y) == (180, 10)
    assert (img.position_x, img.position_y) == (160, 10)
    assert (div.position_x, div.position_y) == (140, 10)
    assert (article.position_x, article.position_y) == (0, 0)
    assert marker.position_x == ul.position_x


@assert_no_logs
def test_fixed_positioning_regression_2():
    # Regression test for https://github.com/Kozea/WeasyPrint/issues/728

    page_1, page_2 = render_pages('''