[issue14403] unittest module: provide inverse of "assertRaises"

2012-03-25 Thread Michael Foord
Michael Foord added the comment: The opposite of calling assertRaises is simply calling the code. A comment as to why you're calling the code is sufficient documentation as to the intent of the test. In general the difference be a test failure and error is not useful - you *still* have to lo

[issue14403] unittest module: provide inverse of "assertRaises"

2012-03-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: > >> I don't want to simply execute the code and hope that it doesn't raise > >> an exception, because if it does, the test fails with an "error" status > >> instead of a "failed" status. > > > > So what? > > A buggy test is not the same thing as a test that

[issue14403] unittest module: provide inverse of "assertRaises"

2012-03-25 Thread Danilo Bargen
Danilo Bargen added the comment: >> I don't want to simply execute the code and hope that it doesn't raise >> an exception, because if it does, the test fails with an "error" status >> instead of a "failed" status. > > So what? A buggy test is not the same thing as a test that fails because

[issue14403] unittest module: provide inverse of "assertRaises"

2012-03-25 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I don't want to simply execute the code and hope that it doesn't raise > an exception, because if it does, the test fails with an "error" status > instead of a "failed" status. So what? -- components: +Library (Lib) -Tests nosy: +michael.foord, pit

[issue14403] unittest module: provide inverse of "assertRaises"

2012-03-25 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe : -- nosy: +tshepang ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue14403] unittest module: provide inverse of "assertRaises"

2012-03-25 Thread Danilo Bargen
New submission from Danilo Bargen : Most assert statements of the unittest module provide both an assert statement as well as its inverse, like "assertIn" and "assertNotIn". There is apparently no such thing for exceptions. I can do the following: > with self.assertRaises(SomeException): >