Skip to content

Provide stage to before_every_request hook #716

Description

@rjrudin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions