ConaireD / TolimanWIP

WIP Toliman codes go here before being added to the main TOLIMAN github
Other
0 stars 0 forks source link

Time Tests with `pytest-durations`. #17

Closed Jordan-Dennis closed 1 year ago

Jordan-Dennis commented 1 year ago

Hi all, I think that this plugin will provide useful information that pytest-benchmark will not. We will only benchmark mission criticall function calls like __call__ ect. Duration simply times the tests. This links back to the F.I.R.S.T principles in that it will show us what tests are taking a lng time to executre. We can then mark these tests with pytest.mark.slow(), and run them as a separate group providing that the faster tests passed. Regards Jordan.

Jordan-Dennis commented 1 year ago

Another alternative is pytest-timer which looks very polished.

Jordan-Dennis commented 1 year ago

This is a screenshot of using pytest-durations on the TolimanOptics tests. image

Jordan-Dennis commented 1 year ago

image This is using pytest-timer which I think is a little nicer.

Jordan-Dennis commented 1 year ago

I found pytest-timer the better of the pair because it has more features and is colored. The report is less detailed but it is still good enough for finding bottlenecks.