Function-Profiler
Function-Profiler copied to clipboard
add tests for `profiler.FunctionLogger.log_data`
The problems with testing log_data
are that:
- The logged times are system-dependent. It's possible to mock these times.
- The function fulfills several purposes: some logical checks, creating the statistical strings, and writing to some designated output. Unit-testing a function with so many effects is tedious and a bit of an anti-pattern. Maybe the
log_data
function should be broken up into a few more modular functions that are then easier to test.