def METHOD_NAME(self, testdata):
    """
    Tests that reading and writing a CMTSOLUTION file does not change
    anything.
    This time it tests reading from and writing to open files.
    """
    filename = testdata['CMTSOLUTION']
    with open(filename, "rb") as fh:
        data = fh.read()
        fh.seek(0, 0)
        cat = obspy.read_events(fh)
    with NamedTemporaryFile() as tf:
        cat.write(tf, format="CMTSOLUTION")
        tf.seek(0, 0)
        new_data = tf.read()
    assert data.decode().splitlines() == new_data.decode().splitlines()