New issue 517: setup_method executed before session fixtures https://bitbucket.org/hpk42/pytest/issue/517/setup_method-executed-before-session
Haak Saxberg: consider the following dummy test file: ``` #!python import pytest @pytest.yield_fixture(scope="session", autouse=True) def print_session(): print "session fixture" yield print "session teardown" class TestClass(object): def setup_method(self, method): print "method setup" def teardown_method(self, method): print "method teardown" def test_printer(self): print "test method" ``` `pytest --capture=no test_file.py` will generate the following output: ``` #!bash ==================== test session starts ==================== platform darwin -- Python 2.7.5 -- py-1.4.20 -- pytest-2.5.2 collected 1 items tests/test_ordering.py method setup session fixture test method .method teardown session teardown ================= 1 passed in 0.01 seconds ================= ``` that doesn't seem right, especially since the teardowns are in the correct order. In fact it's pretty bad, because you might (I would think rightly) depend on the session having been set up already in your setup_method. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit