[py-dev] order of setup / teardown

Philippe Fremy phil at freehackers.org
Mon Apr 12 12:37:36 CEST 2010


Hi,

I am not sure if this has been brought before, but I am surprised to see
some calls inside the test "hooks" after the test session has finished.

I am referring here to teardown_class, revealed by a quick example:

pytest_sessionstart

setup_class
setup_method

test1

teardown_method

setup_method
test2

teardown_method

pytest_sessionfinish

teardown_class

This is creating problems for me because
         I am assuming that all resources are setup in sesssionstart,
and torn down in sessionfinish. And teardown_class is using  one of
those resources.

Is it a bug or intended behavior ?

cheers,

Philippe






More information about the Pytest-dev mailing list