<div dir="ltr">Greetings from Canada :-)<div><br></div><div>I&#39;m trying to speed up the CI cycle on one project I&#39;m working on and I&#39;m trying to to figure out where time is spent by the test suite.</div><div><br></div><div>I just discovered the excellent --durations option[1] which prints a neat report containing the slowest tests.</div><div><br></div><div>This has been of much help to get started (I&#39;ve already spotted a few tests to optimize), but it doesn&#39;t seem to track time spent in test fixtures.  I&#39;d like to track metrics for test fixtures, including number of calls, total time spent in order to optimize the slower fixtures.</div><div><br></div><div>I&#39;ve started reading into the Writing Plugins section[2] and pytest hook reference[3] to see if I can script my own plug-in for this, but I&#39;m having a hard time understand if and how I can do this.</div><div><br></div><div>Can anyone give me any pointers in how to accomplish this?</div><div><br></div><div>Thanks!</div><div><br></div><div>André</div><div><br></div><div>[1]: <a href="http://docs.pytest.org/en/latest/usage.html#profiling-test-execution-duration">http://docs.pytest.org/en/latest/usage.html#profiling-test-execution-duration</a></div><div>[2]: <a href="http://doc.pytest.org/en/latest/writing_plugins.html">http://doc.pytest.org/en/latest/writing_plugins.html</a></div><div>[3]: <a href="http://doc.pytest.org/en/latest/writing_plugins.html#pytest-hook-reference">http://doc.pytest.org/en/latest/writing_plugins.html#pytest-hook-reference</a></div></div>