All this stuff is indented. I use a context manager here to make sure the `Canvas` gets closed even if a test errors.