comparison tests/run-tests.py @ 13031:3da456d0c885

code style: prefer 'is' and 'is not' tests with singletons
author Martin Geisler <mg@aragost.com>
date Mon, 22 Nov 2010 18:15:58 +0100
parents 6747d4a5c45d
children ce07defe7d9f
comparison
equal deleted inserted replaced
13030:8ea51e9e7031 13031:3da456d0c885
592 if os.name == 'nt' or sys.platform.startswith('java'): 592 if os.name == 'nt' or sys.platform.startswith('java'):
593 tochild, fromchild = os.popen4(cmd) 593 tochild, fromchild = os.popen4(cmd)
594 tochild.close() 594 tochild.close()
595 output = fromchild.read() 595 output = fromchild.read()
596 ret = fromchild.close() 596 ret = fromchild.close()
597 if ret == None: 597 if ret is None:
598 ret = 0 598 ret = 0
599 else: 599 else:
600 proc = Popen4(cmd) 600 proc = Popen4(cmd)
601 def cleanup(): 601 def cleanup():
602 os.kill(proc.pid, signal.SIGTERM) 602 os.kill(proc.pid, signal.SIGTERM)
712 skipped = (ret == SKIPPED_STATUS) 712 skipped = (ret == SKIPPED_STATUS)
713 713
714 # If we're not in --debug mode and reference output file exists, 714 # If we're not in --debug mode and reference output file exists,
715 # check test output against it. 715 # check test output against it.
716 if options.debug: 716 if options.debug:
717 refout = None # to match out == None 717 refout = None # to match "out is None"
718 elif os.path.exists(ref): 718 elif os.path.exists(ref):
719 f = open(ref, "r") 719 f = open(ref, "r")
720 refout = splitnewlines(f.read()) 720 refout = splitnewlines(f.read())
721 f.close() 721 f.close()
722 else: 722 else: