python-pytest-steps icon indicating copy to clipboard operation
python-pytest-steps copied to clipboard

`@cross_steps_fixture` does not wait for the last step to perform teardown

Open smarie opened this issue 6 years ago • 0 comments

From reading the code I realize that there is nothing preventing pytest to execute the fixture teardown after the first step. So even if you decorate the fixture with @cross_steps_fixture, the value will be reused but it might be disfunctional.

Teardown hook should therefore be executed after all steps

Challenges:

  • there are several teardown hooks for fixtures as of today. We have to make sure that we capture all of them and replace them with dummy ones - and finally call them after the last step
  • we have to know the name of the last step also...

smarie avatar Dec 21 '18 09:12 smarie