    def test_context_manager(self):
        """
        Check ManagedScreen context manager works.
        """
        with ManagedScreen() as screen:
            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")
Check ManagedScreen context manager works.
tests/test_screen.py