Skip to content

Commit 204c374

Browse files
committed
fix(test): exclude polling loop branches from coverage
Add pragma: no branch to the polling loop conditionals in process cleanup tests. These false branches (loop retry) are only exercised on slow Windows CI runners and cannot be covered locally. Github-Issue:#6
1 parent f54625c commit 204c374

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tests/client/test_stdio.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ async def test_basic_child_process_cleanup(self):
324324
size_after_cleanup = os.path.getsize(marker_file)
325325
await anyio.sleep(0.5)
326326
final_size = os.path.getsize(marker_file)
327-
if final_size == size_after_cleanup:
327+
if final_size == size_after_cleanup: # pragma: no branch
328328
print(f"After cleanup: file stopped at {final_size} bytes")
329329
break
330330

@@ -429,7 +429,7 @@ async def test_nested_process_tree(self):
429429
size1 = os.path.getsize(file_path)
430430
await anyio.sleep(0.5)
431431
size2 = os.path.getsize(file_path)
432-
if size1 == size2:
432+
if size1 == size2: # pragma: no branch
433433
break
434434

435435
print("SUCCESS: All processes in tree terminated")
@@ -511,7 +511,7 @@ def handle_term(sig, frame):
511511
size3 = os.path.getsize(marker_file)
512512
await anyio.sleep(0.5)
513513
size4 = os.path.getsize(marker_file)
514-
if size3 == size4:
514+
if size3 == size4: # pragma: no branch
515515
break
516516

517517
print("SUCCESS: Child terminated even with parent exit during cleanup")

0 commit comments

Comments
 (0)