def test_ipython_embed():
 with NamedFileInTemporaryDirectory('file_with_embed.py') as f:
  f.write(_sample_embed)
  f.flush()
  f.close()
  cmd = [sys.executable, f.name]
  env = os.environ.copy()
  env['IPY_TEST_SIMPLE_PROMPT'] = '1'
  p = subprocess.Popen(cmd, env=env, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  (out, err) = p.communicate(_exit)
  std = out.decode('UTF-8')
  nt.assert_equal(p.returncode, 0)
  nt.assert_in('3 . 14', std)
  if (os.name != 'nt'):
   nt.assert_in('IPython', std)
  nt.assert_in('bye!', std)

def test_ipython_embed ( ) : with NamedFileInTemporaryDirectory ( 'file_with_embed.py' ) as f : f . write ( _sample_embed ) f . flush ( ) f . close ( ) cmd = [ sys . executable , f . name ] env = os . environ . copy ( ) env [ 'IPY_TEST_SIMPLE_PROMPT' ] = '1' p = subprocess . Popen ( cmd , env = env , stdin = subprocess . PIPE , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) ( out , err ) = p . communicate ( _exit ) std = out . decode ( 'UTF-8' ) nt . assert_equal ( p . returncode , 0 ) nt . assert_in ( '3 . 14' , std ) if ( os . name != 'nt' ) : nt . assert_in ( 'IPython' , std ) nt . assert_in ( 'bye!' , std )
test that ipython .