File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -975,3 +975,29 @@ def test2(): pass
975975            "* 1 failed in *" ,
976976        ]
977977    )
978+ 
979+ 
980+ def  test_nested (pytester : pytest .Pytester ) ->  None :
981+     """ 
982+     Currently we do nothing special with nested subtests. 
983+ 
984+     This test only sediments how they work now, we might reconsider adding some kind of nesting support in the future. 
985+     """ 
986+     pytester .makepyfile (
987+         """ 
988+         import pytest 
989+         def test(subtests): 
990+             with subtests.test("a"): 
991+                 with subtests.test("b"): 
992+                     assert False, "b failed" 
993+                 assert False, "a failed" 
994+         """ 
995+     )
996+     result  =  pytester .runpytest_subprocess ()
997+     result .stdout .fnmatch_lines (
998+         [
999+             "[b] SUBFAILED test_nested.py::test - AssertionError: b failed" ,
1000+             "[a] SUBFAILED test_nested.py::test - AssertionError: a failed" ,
1001+             "* 3 failed in *" ,
1002+         ]
1003+     )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments