login
Holden Web
What you'll need to know tomorrow

Comments on Tests That Test Your Tests

Good point about tests in loops, or any other code...

peter9477 ยท 2010-08-06T14:12:27.002000

Good point about tests in loops, or any other code path that may not be entered.

A common technique to avoid this issue (though the sanity-test approach is good too) is to assert something about the data before using it. Here I'd do a simple self.assert_(self.msgids) before the loop, or perhaps something more specific with len(self.msgids)

Page 1 of 1

Back to post