def test_pyc():
    """Test pyc compilation."""
    f = tempfile.NamedTemporaryFile(suffix='.hy', delete=False)
    f.write(b'(defn pyctest [s] s)')
    f.close()

    write_hy_as_pyc(f.name)
    os.unlink(f.name)

    cfile = f.name[:-len(".hy")] % "%s.pyc"
    mod = imp.load_compiled('pyc', cfile)
    os.unlink(cfile)

    assert mod.pyctest('Foo') == 'Foo'
dataset/ETHPy150Open hylang/hy/tests/importer/test_pyc.py/test_pyc/swapped operands of `%`