ionelmc / pytest-benchmark

py.test fixture for benchmarking code
BSD 2-Clause "Simplified" License
1.22k stars 115 forks source link

Ability to to disable stats (quiet mode) #261

Open ssbarnea opened 1 month ago

ssbarnea commented 1 month ago

I am using the plugin in order to detect if some bits of code endup being too slow and fail these tests, but I do not want to get extra output on all executions of pytest as a side effect.

--------------------------------------- benchmark 'completion': 1 tests ----------------------------------------
Name (time in ms)            Min     Max    Mean  StdDev  Median     IQR  Outliers       OPS  Rounds  Iterations
----------------------------------------------------------------------------------------------------------------
test_completion_speed     2.1955  3.0038  2.4342  0.2677  2.3236  0.3572       2;0  410.8077      10           1
----------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

How can I avoid getting these on console when tests are passing? These are useful to me only in case of test failures.