We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d240ce commit 7418fafCopy full SHA for 7418faf
testing/acceptance_test.py
@@ -964,3 +964,27 @@ def test2():
964
""")
965
result = testdir.runpytest()
966
result.stdout.fnmatch_lines(['* 2 passed *'])
967
+
968
969
+def test_fixture_order_respects_scope(testdir):
970
+ """Ensure that fixtures are created according to scope order, regression test for #2405
971
+ """
972
+ testdir.makepyfile('''
973
+ import pytest
974
975
+ data = {}
976
977
+ @pytest.fixture(scope='module')
978
+ def clean_data():
979
+ data.clear()
980
981
+ @pytest.fixture(autouse=True)
982
+ def add_data():
983
+ data.update(value=True)
984
985
+ @pytest.mark.usefixtures('clean_data')
986
+ def test_value():
987
+ assert data.get('value')
988
+ ''')
989
+ result = testdir.runpytest()
990
+ assert result.ret == 0
0 commit comments