smarie / python-pytest-steps

A tiny package to ease the creation of test steps with shared intermediate results/state.
https://smarie.github.io/python-pytest-steps/
BSD 3-Clause "New" or "Revised" License
56 stars 5 forks source link

define steps as "yield" statements in a generator test function #6

Closed smarie closed 5 years ago

smarie commented 5 years ago

It would seem cool/intuitive to be able to breakdown a test function into steps by just using yield in the test function, thus defining the end of each step.

smarie commented 5 years ago

Of course the main issue is with the custom fixtures that return a new value for each test node: we would need to handle this so as to inject it into the variable already referenced by the generator in execution.