[svn r40737] A fix that allows (for command line reporter) to report failure in case

when FAILED TO LOAD MODULE

--HG--
branch : trunk
This commit is contained in:
fijal 2007-03-18 23:38:57 +01:00
parent cfd7c31a8d
commit 3943673739
2 changed files with 7 additions and 2 deletions

View File

@ -280,6 +280,8 @@ class RemoteReporter(AbstractReporter):
def report_FailedTryiter(self, event):
self.out.line("FAILED TO LOAD MODULE: %s\n" % "/".join(event.item.listnames()))
self.failed_tests_outcome.append(event)
# argh! bad hack, need to fix it
self.failed[self.hosts[0]] += 1
def report_SkippedTryiter(self, event):
self.out.line("Skipped (%s) %s\n" % (str(event.excinfo.value), "/".
@ -301,6 +303,7 @@ class LocalReporter(AbstractReporter):
#self.show_item(event.item, False)
self.out.write("- FAILED TO LOAD MODULE")
self.failed_tests_outcome.append(event)
self.failed[self.hosts[0]] += 1
def report_ReceivedItemOutcome(self, event):
host = self.hosts[0]

View File

@ -135,11 +135,13 @@ class AbstractTestReporter(BasicRsessionTest):
r.report(repevent.RsyncFinished())
list(rootcol._tryiter(reporterror=lambda x : AbstractSession.reporterror(r.report, x)))
r.report(repevent.TestFinished())
return r
cap = py.io.StdCaptureFD()
boxfun()
r = boxfun()
out, err = cap.reset()
assert not err
assert out.find("1 failed in") != -1
assert out.find("NameError: name 'sadsadsa' is not defined") != -1
def _test_still_to_go(self):
@ -187,7 +189,7 @@ class TestLocalReporter(AbstractTestReporter):
repmod/test_one.py[1]
repmod/test_three.py[0] - FAILED TO LOAD MODULE
repmod/test_two.py[0] - skipped (reason)"""
assert received.find(expected) != -1
assert received.find(expected) != -1
class TestRemoteReporter(AbstractTestReporter):
reporter = RemoteReporter