Can pytest be made to fail if nothing is asserted?
Today I had a failing test that happily succeeded, because I forgot a rather important line at the end: assert actual == expected I would like to have the machine catch this mistake in the future. Is there a way to make pytest detect if a test function does not assert anything, and consider this a test failure? Of course, this needs to be a "global" configuration setting; annotating each test function with @fail_if_nothing_is_asserted would defeat the purpose. This is one of the reasons why it really helps to write a failing test before writing the code to make the test pass. It's that one