def test_pyc():
 f = tempfile.NamedTemporaryFile(suffix='.hy', delete=False)
 f.write('(defn pyctest [s] s)')
 f.close()
 write_hy_as_pyc(f.name)
 os.unlink(f.name)
 cfile = ('%s.pyc' % f.name[:(- len('.hy'))])
 mod = imp.load_compiled('pyc', cfile)
 os.unlink(cfile)
 assert (mod.pyctest('Foo') == 'Foo')

def test_pyc ( ) : f = tempfile . NamedTemporaryFile ( suffix = '.hy' , delete = False ) f . write ( '(defn pyctest [s] s)' ) f . close ( ) write_hy_as_pyc ( f . name ) os . unlink ( f . name ) cfile = ( '%s.pyc' % f . name [ : ( - len ( '.hy' ) ) ] ) mod = imp . load_compiled ( 'pyc' , cfile ) os . unlink ( cfile ) assert ( mod . pyctest ( 'Foo' ) == 'Foo' )
test pyc compilation .