What are the advantages or difference in “assert False” and “self.assertFalse”
问题 I am writing tests and I have heard some people saying to use self.assertFalse rather than assert False. Why is this and are there any advantages to be had? 回答1: assert False throws an exception without useful logging information. The test had an error. self.assertFalse() throws a test failure exception with test failure information like a message and a test name. There's a difference between an error -- test could not even run -- and a failure -- test code worked but produced the wrong