taverntesting / tavern

A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax
https://taverntesting.github.io/
MIT License
1.02k stars 193 forks source link

How feasible would be write a plugin to transform a shared stage into a session-scoped fixture? #856

Open pythrick opened 1 year ago

pythrick commented 1 year ago

I just came up from the doc in usefixture session, and I really enjoyed the way it was designed. I just would like to have the same capabilities to transform/wrap a shared stage into a session-scoped fixture like that, because I would like to avoid writing http requests in Python code, since we're already using Tavern.

Would any of you have an idea on how to achieve that? Some guidance on what to look for? Great tool by the way, I'm learning a lot and enjoying it so much. Thanks for all your efford maintaining it.

image

michaelboulton commented 1 year ago

This can't be done because stage execution is done after fixtures are actually evaluated, and all the code to check responses and format variables etc. in stages is fairly intricately tied in with the inner workings of all the code that runs the stages the way it is now.