pytest-profiling: ability to have a svg output per test
Hello,
I had to debug some strange warmup behaviors yesterday and I needed to compare two runs (with --count=2) to be able to understand the issue.
More generally, It looks like a nice addition to be able to have one svg output per test.
What is your view on that?
Ben
I think this is a great idea! We could control it with a command-line switch, how does this sound? I'm taking a leaf here from pytest's fixture scoping to control what the output is:
py.test test_foo.py # combined output
py.test --profile-scope=session # same as above
py.test --profile-scope=function # one SVG per function
py.test --profile-scope=module # one SVG per module
The scope parameter idea is really great :+1:
But am not sure we would be able to have the finest granularity with a function scope.
We would need a "call" scope like they imagined in https://github.com/pytest-dev/pytest/issues/2833 that would be a parametrized instance of a test / function.
Does that make sense?
edit: I may have misunderstood the call scope idea and how behave the function scope :)
A module scope would be very useful for @coala , especially if it works without the SVG, i.e. a pstats printout per module.