Comments
Patch
@@ -466,7 +466,8 @@
# the stack trace. This is for historical reasons and
# this decision could be revisted in the future,
# especially for PythonTest instances.
- result.addFailure(self, str(e))
+ if result.addFailure(self, str(e)):
+ success = True
except Exception:
result.addError(self, sys.exc_info())
else:
@@ -1077,6 +1078,18 @@
self.stop()
else:
self.stream.write('\nERROR: %s output changed\n' % test)
+ if self._options.interactive:
+ iolock.acquire()
+ self.stream.write('Accept this change? [n] ')
+ answer = sys.stdin.readline().strip()
+ iolock.release()
+ if answer.lower() in ('y', 'yes'):
+ if test.name.endswith('.t'):
+ rename(test.errpath, test.path)
+ else:
+ rename(test.errpath, '%s.out' % test.path)
+ self.failures.pop()
+ return 1
self.stream.write('!')
def addError(self, *args, **kwargs):
@@ -1136,20 +1149,9 @@
self.stream.write(line)
self.stream.flush()
- if ret or not self._options.interactive or \
- not os.path.exists(test.errpath):
+ if ret or not self._options.interactive or os.path.exists(test.errpath):
return
- iolock.acquire()
- print 'Accept this change? [n] ',
- answer = sys.stdin.readline().strip()
- iolock.release()
- if answer.lower() in ('y', 'yes'):
- if test.name.endswith('.t'):
- rename(test.errpath, test.path)
- else:
- rename(test.errpath, '%s.out' % test.path)
-
def startTest(self, test):
super(TestResult, self).startTest(test)