def METHOD_NAME():
    with Image.open(test_file) as im:
        # PSD seek index starts at 1 rather than 0
        n_frames = im.n_frames + 1
        # Test seeking past the last frame
        with pytest.raises(EOFError):
            im.seek(n_frames)
        assert im.tell() < n_frames
        # Test that seeking to the last frame does not raise an error
        im.seek(n_frames - 1)