Report number of assertions in pyTest
<p>I am using <code>pytest</code> for writing some tests at integration level. I would like to be able to also report the number of assertions done on each test case. By default, <code>pytest</code> will only report the number of test cases which have passed and failed.</p>

<p>On assertion further execution of test is aborted. So there will always be 1 assertion per test.</p>

<p>To achieve what you want you will have to write your own wrapper over assertion to keep track. At the end of the test check if count is >0 then raise assertion.
The count can be reset to zero either the <code>setup</code> or at <code>teardown</code> of test.</p>

python integration-testing py.test