[TIP] Identifying slowest py.test fixtures
andre.l.caron at gmail.com
Fri Jul 22 09:20:44 PDT 2016
Greetings from Canada :-)
I'm trying to speed up the CI cycle on one project I'm working on and I'm
trying to to figure out where time is spent by the test suite.
I just discovered the excellent --durations option which prints a neat
report containing the slowest tests.
This has been of much help to get started (I've already spotted a few tests
to optimize), but it doesn't seem to track time spent in test fixtures.
I'd like to track metrics for test fixtures, including number of calls,
total time spent in order to optimize the slower fixtures.
I've started reading into the Writing Plugins section and pytest hook
reference to see if I can script my own plug-in for this, but I'm having
a hard time understand if and how I can do this.
Can anyone give me any pointers in how to accomplish this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python