Merge pull request #255 from johannesmoene/fix-python-print

Fix python print
This commit is contained in:
Phil Nash
2014-04-21 19:15:44 +01:00
3 changed files with 22 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
from __future__ import print_function
import os
import sys
import subprocess
@@ -66,20 +68,20 @@ def approve( baseName, args ):
rawFile.close()
os.remove( rawResultsPath )
print
print baseName + ":"
print()
print( baseName + ":" )
if os.path.exists( baselinesPath ):
diffResult = subprocess.call([ "diff", baselinesPath, filteredResultsPath ] )
if diffResult == 0:
os.remove( filteredResultsPath )
print " \033[92mResults matched"
print( " \033[92mResults matched" )
else:
print " \n****************************\n \033[91mResults differed"
print( " \n****************************\n \033[91mResults differed" )
if diffResult > overallResult:
overallResult = diffResult
print "\033[0m"
print( "\033[0m" )
else:
print " first approval"
print( " first approval" )
if overallResult == 0:
overallResult = 1
@@ -94,6 +96,6 @@ approve( "junit.sw", ["~_", "-s", "-w", "NoAssertions", "-r", "junit"] )
# xml reporter, include passes, warn about No Assertions
approve( "xml.sw", ["~_", "-s", "-w", "NoAssertions", "-r", "xml"] )
if overallResult <> 0:
print "run approve.py to approve new baselines"
exit( overallResult)
if overallResult != 0:
print( "run approve.py to approve new baselines" )
exit( overallResult)