def check_screen_and_canvas(screen, fn):
    """
    Helper function to check that a Screen and Canvas work identically.

    :param screen: The screen object to use for the test.
    :param fn: The function to call for the test.
    """
    for test_object in (screen, Canvas(screen, screen.height, screen.width)):
        fn(test_object)
Helper function to check that a Screen and Canvas work identically.

:param screen: The screen object to use for the test.
:param fn: The function to call for the test.
tests/test_screen.py