Commits

Anonymous committed d35b987

printing to sys.stderr for subprocess mode results

Comments (0)

Files changed (2)

 
     ret_code = None
     response = []
+    # err = []
 
     t = time.time()
     while ret_code is None and ((time.time() -t) < time_out):
         ret_code = proc.poll()
         response += [proc.read_async(wait=0.1, e=0)]
+        # err      += [proc.read_async(wait=0.1, e=0, stderr=1)]
 
     if ret_code is None:
         ret_code = '"Process timed out (time_out = %s secs) ' % time_out
         except (win32api.error, OSError), e:
             ret_code += 'and termination failed (exception: %s)"' % e
 
-    return ret_code, ''.join(response)
+    return ret_code, ''.join(response) #+ ''.join(err)
 
 ################################################################################
 
 # NOTE: regexes will possibly fail if tests are noisy on stdout or stderr
 #       so use -r --redirect io option when using subprocess
 
+def print_err(*args):
+    for arg in args: sys.stderr.write(arg + '\n')
+
 all_dots = ''
 failures = []
 
 total_fails, total_errors = map(all_dots.count, 'FE')
 total_tests = len(all_dots)
 
-print all_dots
-if failures: print ''.join(failures).lstrip('\n')[:-1]
-print "%s %s tests in %.3fs\n" % (RAN_TESTS_DIV, total_tests, t)
+print_err(all_dots)
+if failures: print_err(''.join(failures).lstrip('\n')[:-1])
+print_err("%s %s tests in %.3fs\n" % (RAN_TESTS_DIV, total_tests, t))
 
 if not failures:
-    print 'OK'
+    print_err('OK')
 else:
-    print 'FAILED (%s)' % ', '.join (
+    print_err ('FAILED (%s)' % ', '.join (
         (total_fails  and ["failures=%s" % total_fails] or []) +
         (total_errors and ["errors=%s"  % total_errors] or [])
-    )
+    ))
 
 ################################################################################
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.