def METHOD_NAME(data, tmpdir, format):
    d = {'a': 2}
    dumpstring = pydict_text_io.dump(d, format)
    f = tmpdir.join('test-dump.%s' % format)
    f.write(dumpstring)
    fileobj = str(f)
    assert pydict_text_io.load(fileobj, format) == d