def METHOD_NAME():
    mesh = UnitSquareMesh(2, 2)
    V = FunctionSpace(mesh, "CG", 1)
    u = Function(V)
    v = TestFunction(V)
    F = inner(u, v) * dx - conj(v) * dx
    problem = NonlinearVariationalProblem(F, u)
    solver1 = NonlinearVariationalSolver(problem, solver_parameters={"ksp_type": "cg"},
                                         options_prefix="foo_")
    solver2 = NonlinearVariationalSolver(problem, solver_parameters={"ksp_type": "gcr"},
                                         options_prefix="foo_")
    assert solver1.snes.ksp.getType() == "cg"
    assert solver2.snes.ksp.getType() == "gcr"
    with pytest.raises(PETSc.Error) as excinfo:
        solver2 = NonlinearVariationalSolver(problem, solver_parameters={"ksp_type": "bork"},
                                             options_prefix="foo_")
    # Unknown KSP type
    assert excinfo.value.ierr == 86