Changeset 175
- Timestamp:
- 02/07/07 04:43:44 (5 years ago)
- Files:
-
- trunk/cheesecake/util.py (modified) (4 diffs)
- trunk/tests/unit/test_index_pylint.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cheesecake/util.py
r174 r175 25 25 """ 26 26 arglist = cmd.split() 27 28 output = os.tmpfile() 27 29 try: 28 p = Popen(arglist, stdout= PIPE, stderr=STDOUT, env=env)30 p = Popen(arglist, stdout=output, stderr=STDOUT, env=env) 29 31 except Exception, e: 30 32 return 1, e … … 34 36 start = time.time() 35 37 while p.poll() is None: 36 time.sleep( 1)38 time.sleep(0.1) 37 39 if time.time() - start > max_timeout: 38 40 os.kill(p.pid, signal.SIGINT) … … 40 42 return 1, "Time exceeded" 41 43 42 output = p.communicate()[0] 43 return p.returncode, output 44 p.wait() 45 output.seek(0) 46 return p.returncode, output.read() 44 47 45 48 def command_successful(cmd): … … 52 55 """ 53 56 rc, output = run_cmd(cmd) 54 if rc: 55 return False 56 return True 57 return rc == 0 57 58 58 59 class StdoutRedirector(object): trunk/tests/unit/test_index_pylint.py
r174 r175 43 43 cheesecake = CheesecakeMockup() 44 44 45 # Raise maximum execution time to 5 minutes, so test won't fail46 # on slower machines.47 index.max_execution_time = 5*6048 49 45 index.compute_with(cheesecake) 50 46 assert index.details != "encountered an error during pylint execution"
