I am also interested into printing the count of assertions of unit-tests with pytest.
Although I do not have a working solution, this piece of documentation shows that pytest rewrites the statements assert
behind the scene: https://docs.pytest.org/en/stable/how-to/assert.html#assert-details
The fact that pytest rewrites the statements assert
has been there for a while, see this blog post pointed by the documentation: https://pybites.blogspot.com/2011/07/behind-scenes-of-pytests-new-assertion.html
That invalidates a comment above saying that pytest uses Python's native assert
.
Though I still don't know how to have pytest print the count of assert
s. Maybe with a plugin.