Commit c2f6e4af authored by Grégory Wisniewski's avatar Grégory Wisniewski

The test runner notice when it fails to send the report by mail.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1203 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 76e270d4
...@@ -290,7 +290,10 @@ class NeoTestRunner(unittest.TestResult): ...@@ -290,7 +290,10 @@ class NeoTestRunner(unittest.TestResult):
s.connect(*SMTP_SERVER) s.connect(*SMTP_SERVER)
mail = msg.as_string() mail = msg.as_string()
for recipient in RECIPIENTS: for recipient in RECIPIENTS:
try:
s.sendmail(SENDER, recipient, mail) s.sendmail(SENDER, recipient, mail)
except smtplib.SMTPRecipientsRefused:
print "Mail for %s fails" % recipient
s.close() s.close()
if __name__ == "__main__": if __name__ == "__main__":
...@@ -305,9 +308,9 @@ if __name__ == "__main__": ...@@ -305,9 +308,9 @@ if __name__ == "__main__":
if FUNCTIONAL_TESTS: if FUNCTIONAL_TESTS:
runner.run('Functional tests', FUNC_TEST_MODULES) runner.run('Functional tests', FUNC_TEST_MODULES)
runner.build() runner.build()
# send a mail
if SEND_REPORT:
runner.sendReport()
print runner.errors print runner.errors
print runner.warnings print runner.warnings
print runner.summary print runner.summary
# send a mail
if SEND_REPORT:
runner.sendReport()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment