pytest_runtest_setup is calling teardown code #4038
Labels
topic: fixtures
anything involving fixtures directly or indirectly
type: refactoring
internal improvements to the code
Dear All, here is my bug report on pytest behavior where the
pytest_runtest_setup
calls teardown code which should be called by thepytest_fixture_teardown
hook.Environment: [ pytest 3.8.1, pluggy 0.7.1, python 3.5.4, py 1.6.0, os 'windows 10 64-bit']
Conditions:
Behavior:
pytest_runtest_setup
hook of the next item's call.pytest_runtest_makereport
hook is always called before the teardown code called bypytest_runtest_setup
Comments:
The behaviour that I would prefer and suggest is that all teardowns are called from within the
pytest_fixture_teardown
hook and not from the pytest_runtest_setup hook for the next item. I will look into changes that would make this possible.P.S. First time posting on here. Thank you to everyone who has made pytest a useful tool to me.
Example Code:
The text was updated successfully, but these errors were encountered: