You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pytest_tavern_beta_before_every_request hook is very handy for logging each request as a test runs. But endpoint URLs aren't always that self-documenting, sometimes leaving the developer thinking - hmm, I wonder what the call just did?
The "name" of a stage seems to be a great way to describe what a call is expected to do. I'd really like to include this in the logs for every request, but I don't have access to that based on the current hook interface. The goal would be that a developer - particularly one new to the project - could run a Tavern test and watch the logs to see not only what calls are being made (and how long each takes, which can be informative), but also what the call is expected to do,
I'm wondering if the entire stage config could be passed to the before_every_request hook, which of course would include the url, which is my primary motivation.
The text was updated successfully, but these errors were encountered:
From the description I think this would fall under the topic of having a way of running a generic function before/after each request in a stage like in #114 ? The current pytest hooks for 'before every request' and 'after every response' were a bit of a stopgap for that.
In the meantime, if you do want to be able to provide a view of what requests are doing and how long they take you could try using the allure support (example) but this obviously isn't exactly what you want.
I think #114 would address this need, assuming that the "context" object provides the stage config, which it presumably would. And I like the semantics of "before" and "after" vs the current stopgap hooks. I am fine then with this ticket being closed and linked to via #114 as an example of what 114 could address.
The pytest_tavern_beta_before_every_request hook is very handy for logging each request as a test runs. But endpoint URLs aren't always that self-documenting, sometimes leaving the developer thinking - hmm, I wonder what the call just did?
The "name" of a stage seems to be a great way to describe what a call is expected to do. I'd really like to include this in the logs for every request, but I don't have access to that based on the current hook interface. The goal would be that a developer - particularly one new to the project - could run a Tavern test and watch the logs to see not only what calls are being made (and how long each takes, which can be informative), but also what the call is expected to do,
I'm wondering if the entire stage config could be passed to the before_every_request hook, which of course would include the url, which is my primary motivation.
The text was updated successfully, but these errors were encountered: