jenkins-bot has submitted this change and it was merged.

Change subject: [IMPROV] Test returned content first
......................................................................


[IMPROV] Test returned content first

Instead of just checking the exit code, it's more helpful to actually see the
output difference. For example when it excepts success it would only tell that
it got a failure but not what failed. If it expected a failure and would get
success it would show an empty string which implies that it erroneously
succeeded.

Change-Id: If384513b9f952b91f44dfd0b5a3144abb46f3be7
---
M tests/test_commit-message-validator.py
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, but someone else must approve
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/test_commit-message-validator.py 
b/tests/test_commit-message-validator.py
index b593fa2..6417cba 100644
--- a/tests/test_commit-message-validator.py
+++ b/tests/test_commit-message-validator.py
@@ -34,10 +34,9 @@
                 try:
                     out = StringIO()
                     sys.stdout = out
-                    self.assertEqual(
-                        1 if expected else 0,
-                        cmv.check_message(msg.splitlines()))
+                    exit_code = cmv.check_message(msg.splitlines())
                     self.assertEqual(expected, out.getvalue())
+                    self.assertEqual(exit_code, 1 if expected else 0)
                 finally:
                     sys.stdout = saved_stdout
             return test

-- 
To view, visit https://gerrit.wikimedia.org/r/247018
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If384513b9f952b91f44dfd0b5a3144abb46f3be7
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: XZise <commodorefabia...@gmx.de>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: John Vandenberg <jay...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to