@@ -303,7 +303,7 @@ async def test_basic_child_process_cleanup(self):
303303 assert os .path .exists (parent_marker ), "Parent process didn't start"
304304
305305 # Verify child is writing
306- if os .path .exists (marker_file ):
306+ if os .path .exists (marker_file ): # pragma: no branch
307307 initial_size = os .path .getsize (marker_file )
308308 await anyio .sleep (0.3 )
309309 size_after_wait = os .path .getsize (marker_file )
@@ -318,7 +318,7 @@ async def test_basic_child_process_cleanup(self):
318318
319319 # Verify processes stopped
320320 await anyio .sleep (0.5 )
321- if os .path .exists (marker_file ):
321+ if os .path .exists (marker_file ): # pragma: no branch
322322 size_after_cleanup = os .path .getsize (marker_file )
323323 await anyio .sleep (0.5 )
324324 final_size = os .path .getsize (marker_file )
@@ -335,7 +335,7 @@ async def test_basic_child_process_cleanup(self):
335335 for f in [marker_file , parent_marker ]:
336336 try :
337337 os .unlink (f )
338- except OSError :
338+ except OSError : # pragma: no cover
339339 pass
340340
341341 @pytest .mark .anyio
@@ -406,7 +406,7 @@ async def test_nested_process_tree(self):
406406
407407 # Verify all are writing
408408 for file_path , name in [(parent_file , "parent" ), (child_file , "child" ), (grandchild_file , "grandchild" )]:
409- if os .path .exists (file_path ):
409+ if os .path .exists (file_path ): # pragma: no branch
410410 initial_size = os .path .getsize (file_path )
411411 await anyio .sleep (0.3 )
412412 new_size = os .path .getsize (file_path )
@@ -420,7 +420,7 @@ async def test_nested_process_tree(self):
420420 # Verify all stopped
421421 await anyio .sleep (0.5 )
422422 for file_path , name in [(parent_file , "parent" ), (child_file , "child" ), (grandchild_file , "grandchild" )]:
423- if os .path .exists (file_path ):
423+ if os .path .exists (file_path ): # pragma: no branch
424424 size1 = os .path .getsize (file_path )
425425 await anyio .sleep (0.3 )
426426 size2 = os .path .getsize (file_path )
@@ -433,7 +433,7 @@ async def test_nested_process_tree(self):
433433 for f in [parent_file , child_file , grandchild_file ]:
434434 try :
435435 os .unlink (f )
436- except OSError :
436+ except OSError : # pragma: no cover
437437 pass
438438
439439 @pytest .mark .anyio
@@ -487,7 +487,7 @@ def handle_term(sig, frame):
487487 await anyio .sleep (0.5 )
488488
489489 # Verify child is writing
490- if os .path .exists (marker_file ):
490+ if os .path .exists (marker_file ): # pragma: no cover
491491 size1 = os .path .getsize (marker_file )
492492 await anyio .sleep (0.3 )
493493 size2 = os .path .getsize (marker_file )
@@ -500,7 +500,7 @@ def handle_term(sig, frame):
500500
501501 # Verify child stopped
502502 await anyio .sleep (0.5 )
503- if os .path .exists (marker_file ):
503+ if os .path .exists (marker_file ): # pragma: no branch
504504 size3 = os .path .getsize (marker_file )
505505 await anyio .sleep (0.3 )
506506 size4 = os .path .getsize (marker_file )
@@ -512,7 +512,7 @@ def handle_term(sig, frame):
512512 # Clean up marker file
513513 try :
514514 os .unlink (marker_file )
515- except OSError :
515+ except OSError : # pragma: no cover
516516 pass
517517
518518
@@ -560,7 +560,7 @@ async def test_stdio_client_graceful_stdin_exit():
560560 pytest .fail (
561561 "stdio_client cleanup timed out after 5.0 seconds. "
562562 "Process should have exited gracefully when stdin was closed."
563- )
563+ ) # pragma: no cover
564564
565565 end_time = time .time ()
566566 elapsed = end_time - start_time
@@ -619,7 +619,7 @@ def sigterm_handler(signum, frame):
619619 pytest .fail (
620620 "stdio_client cleanup timed out after 7.0 seconds. "
621621 "Process should have been terminated via SIGTERM escalation."
622- )
622+ ) # pragma: no cover
623623
624624 end_time = time .time ()
625625 elapsed = end_time - start_time
0 commit comments