def METHOD_NAME(self, request, tmpdir):
    if request.param == 'uncompressed':
        return self.ref_filename
    else:
        fn = str(tmpdir.join('file.psf.bz2'))
        with open(self.ref_filename, 'rb') as f:
            stuff = f.read()
        buf = bz2.compress(stuff)
        with open(fn, 'wb') as out:
            out.write(buf)
        return fn