molotov
molotov copied to clipboard
Add scenario in info dict of every molotov events
When writing a molotov event handler (like in example6.py), it would make life easier to have a reference to the scenario in sending_request or response_received events (as it is done for scenario_xxx events).
That would be cool indeed. It requires two things:
- add in ~~LoggedClientSession~~ LoggedClientRequest a scenario property that can be changed
- when the scenario is called, set the property in https://github.com/loads/molotov/blob/master/molotov/worker.py#L172
would you like to takle it ? :)
I'm currently digging it, yes
Notice that since we are in async mode, the scenario value should be linked to the request object, not the session, because the session deals with many requests in parallel
I've seen that, and that makes life a bit harder since the request object is instanciated deep inside the ClientSession._request coroutine...