def METHOD_NAME(surf, fformat, output_engine, input_engine):
    if (input_engine == "python" or output_engine == "python") and fformat not in [
        "irap_ascii",
        "irap_binary",
        "zmap_ascii",
    ]:
        pytest.skip("Only one engine available")
    if fformat == "petromod":
        pytest.xfail("Several hypotesis failures (4)")
    surf.to_file("my_file", fformat=fformat, engine=output_engine)
    surf_from_file = RegularSurface._read_file(
        "my_file", fformat=fformat, engine=input_engine
    )
    assert_similar_surfaces(surf, surf_from_file)