comparison tests/run-tests.py @ 21307:cd4fd7b3c3c4

run-tests: give TestResult a skipped attribute
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 14:01:18 -0700
parents cbf5475827da
children 935ade207253
comparison
equal deleted inserted replaced
21306:cbf5475827da 21307:cd4fd7b3c3c4
647 self.out = None 647 self.out = None
648 self.duration = None 648 self.duration = None
649 self.interrupted = False 649 self.interrupted = False
650 self.exception = None 650 self.exception = None
651 651
652 @property
653 def skipped(self):
654 """Whether the test was skipped."""
655 return self.ret == SKIPPED_STATUS
656
652 def pytest(test, wd, options, replacements, env): 657 def pytest(test, wd, options, replacements, env):
653 py3kswitch = options.py3k_warnings and ' -3' or '' 658 py3kswitch = options.py3k_warnings and ' -3' or ''
654 cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test) 659 cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
655 vlog("# Running", cmd) 660 vlog("# Running", cmd)
656 if os.name == 'nt': 661 if os.name == 'nt':
1063 out = res.out 1068 out = res.out
1064 1069
1065 times.append((test, res.duration)) 1070 times.append((test, res.duration))
1066 vlog("# Ret was:", ret) 1071 vlog("# Ret was:", ret)
1067 1072
1068 skipped = (ret == SKIPPED_STATUS) 1073 skipped = res.skipped
1069 1074
1070 # If we're not in --debug mode and reference output file exists, 1075 # If we're not in --debug mode and reference output file exists,
1071 # check test output against it. 1076 # check test output against it.
1072 if options.debug: 1077 if options.debug:
1073 refout = None # to match "out is None" 1078 refout = None # to match "out is None"