    def test_function_decorator(self):
        """
        Check ManagedScreen function decorator works.
        """
        @ManagedScreen
        def demo(screen=None):
            canvas = Canvas(screen, 10, 40, 0, 0)

            # Check underflow and overflow work as expected
            canvas.print_at("ab", -1, 0)
            canvas.print_at("cd", canvas.width - 1, 0)
            self.assert_line_equals(canvas, "b                                      c")

        demo()
Check ManagedScreen function decorator works.
tests/test_screen.py