Open mgaitan opened 3 years ago
If you would like to write that plugin, I think it would make a lot of sense to write is as a separate package (maybe pytest-line-profiler?) that depends on line_profiler
. Because I'm not the original author, I want to keep the complexity of new additions to a minimum.
If you ensure that your package is tested, on a CI, and published on pypi, I can either give a shout-out to it in the README of this repo, or if your package is really good or becomes popular then I can add it as an optional dependency in extras_require
. Thus if someone was to pip install line_profiler[pytest]
that would include your package.
Let me know if you want to give it a shot, or if you don't have experience in any creating a new python package, running tests on a CI, or publishing on pypi.
@Erotemic pretty clear, thansk. I'll try to get some time from my employer (@shiphero) to implement this idea as an external package. I'll keep u posted.
I've just pushed a first version of this idea https://github.com/mgaitan/pytest-line-profiler. It would be awesome if you can try it and give me some feedback.
I frequently want to execute line_profiler for some function/code under a particular context already defined in a unittest.
So I would like to instrument something equivalent to the
%lprun
magic as a pytest's extension, where I can pass a list of functions to inspect in the command line before theFor instance
would something like this be desirable?