Debian Codegraph @

doc/en/example/fixtures/test_fixtures_request_different_scope.py

raw
1 from __future__ import annotations
2
3 import pytest
4
5
6 @pytest.fixture
7 def order():
8 return []
9
10
11 @pytest.fixture
12 def outer(order, inner):
13 order.append("outer")
14
15
16 class TestOne:
17 @pytest.fixture
18 def inner(self, order):
19 order.append("one")
20
21 def test_order(self, order, outer):
22 assert order == ["one", "outer"]
23
24
25 class TestTwo:
26 @pytest.fixture
27 def inner(self, order):
28 order.append("two")
29
30 def test_order(self, order, outer):
31 assert order == ["two", "outer"]