File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed
pytest_cases/tests/cases/doc Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,33 @@ class SubFooCases:
99 def case_2 (self ):
1010 return 2
1111
12- def case_3 (self ):
12+ class SubSubFooCases :
13+ def case_3 (self ):
14+ return 3
15+
16+ def case_3 (self ): # duplicate name; on purpose
1317 return 3
1418
1519
1620@parametrize_with_cases ("x" , FooCases )
1721def test_foo (x ):
18- print (x )
22+ test_foo .received .append (x )
23+
24+
25+ test_foo .received = []
26+
27+
28+ @parametrize_with_cases ("x" , FooCases .SubFooCases )
29+ def test_subfoo (x ):
30+ test_subfoo .received .append (x )
31+
32+
33+ test_subfoo .received = []
34+
35+
36+ def test_class_with_nested_uses_nested ():
37+ assert test_foo .received == [1 , 2 , 3 , 3 ]
38+
39+
40+ def test_direct_nested_class_reference_works ():
41+ assert test_subfoo .received == [2 , 3 ]
You can’t perform that action at this time.
0 commit comments