Roy Kid
07/17/2024, 10:14 AMspy
in pytest_mock
to check call_count
of function. I think it because when it wrap the object, it loss __module__
information or something else, and inspace.getmodule
can not find its module. I ask this because I want to know how many times the node is executed when I write unit test of caching. Maybe there is another way to do that?Thierry Jean
07/17/2024, 1:45 PMdriver.execute()
and you lose granularly in the Python call stack.
The best approach to know how often a node is executed is to create a lifecycle hook / adapter. Do you want to write tests for your own project or it's to add tests to the Hamilton library?Roy Kid
07/17/2024, 1:52 PMProfilerAdapter
is quite important, and I would like to make a prototype. Once I have a mature design, I will start a draft in hamilton's repo.Roy Kid
07/17/2024, 1:53 PMThierry Jean
07/17/2024, 1:56 PMThat's why I still use hamilton. Quite easy to make an extensionYup, that's the spirit!
Thierry Jean
07/17/2024, 2:00 PMRoy Kid
07/17/2024, 2:04 PM