def test_exit_code():
 exitcode_py = 'exitcode.py'
 f = open(exitcode_py, 'w')
 f.writelines(['import sys\n', 'sys.exit(99)\n'])
 f.close()
 process = System.Diagnostics.Process()
 process.StartInfo.FileName = executable
 process.StartInfo.Arguments = exitcode_py
 process.StartInfo.CreateNoWindow = True
 process.StartInfo.UseShellExecute = False
 process.Start()
 process.WaitForExit()
 if (process.ExitCode != 99):
  print 'SEVERE FAILURE: sys.exit test failed, cannot run tests!'
  System.Environment.Exit(1)

def test_exit_code ( ) : exitcode_py = 'exitcode.py' f = open ( exitcode_py , 'w' ) f . writelines ( [ 'import sys\n' , 'sys.exit(99)\n' ] ) f . close ( ) process = System . Diagnostics . Process ( ) process . StartInfo . FileName = executable process . StartInfo . Arguments = exitcode_py process . StartInfo . CreateNoWindow = True process . StartInfo . UseShellExecute = False process . Start ( ) process . WaitForExit ( ) if ( process . ExitCode != 99 ) : print 'SEVERE FAILURE: sys.exit test failed, cannot run tests!' System . Environment . Exit ( 1 )
verify if we were to fail we would get a good exit code back .