# HG changeset patch # User Augie Fackler <au...@google.com> # Date 1496191620 14400 # Tue May 30 20:47:00 2017 -0400 # Node ID 361bf17d190dbd3410be4b7fd8ff4d27ddb48739 # Parent 9a0a243342b8a2c4d1f75215615785785844f0cb tests: make run-tests fail early if no channel is found
I hit a weird corner case in run-tests where a test that caused an exception to be raised was breaking everything with an unbound variable error a few lines down because channel was never getting set in this for loop. By adding an `else` clause to this for loop, we can explode right away if we can't find a channel and give the developer a better chance at figuring out what's going on. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1767,6 +1767,8 @@ class TestSuite(unittest.TestSuite): if not v: channel = n break + else: + raise ValueError('Could not find output channel') channels[channel] = "=" + test.name[5:].split(".")[0] try: test(result) _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel