def METHOD_NAME(writer, tmpdir):
    u = mda.Universe.empty(10, trajectory=True)
    if writer == mda.coordinates.chemfiles.ChemfilesWriter:
        # chemfiles Writer exists but doesn't work without chemfiles
        if not mda.coordinates.chemfiles.check_chemfiles_version():
            pytest.skip("Chemfiles not available")
        fn = str(tmpdir.join('out.xtc'))
    elif writer == mda.coordinates.MOL2.MOL2Writer:
        pytest.skip("MOL2 only writes MOL2 back out")
    elif writer == mda.coordinates.LAMMPS.DATAWriter:
        pytest.skip("DATAWriter requires integer atom types")
    elif writer == mda.coordinates.H5MD.H5MDWriter and not mda.coordinates.H5MD.HAS_H5PY:
        pytest.skip("skipping H5MDWriter test because h5py is not installed")
    else:
        fn = str(tmpdir.join('out.traj'))
    # H5MDWriter raises ValueError if the trajectory has no units and
    # convert_units is True
    convert_units = (writer != mda.coordinates.H5MD.H5MDWriter)
    with writer(fn, n_atoms=u.atoms.n_atoms, convert_units=convert_units) as w:
        w.write(u.atoms)