Skip to content

Commit dd10fb7

Browse files
Simplify test file writes by removing unnecessary newlines
The child process tests only check that files are growing in size, not their actual content. Removing the newlines simplifies the code and eliminates a potential source of cross-platform issues. This change: - Removes \n from all test file writes - Keeps the timestamp data for file size growth verification - Reduces string escaping complexity Reported-by: fweinberger
1 parent 182263d commit dd10fb7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/client/test_stdio.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ async def test_stdio_client_child_process_cleanup():
389389
import time
390390
with open({repr(marker_file)}, 'a') as f:
391391
while True:
392-
f.write(f"{{time.time()}}\\n")
392+
f.write(f"{time.time()}")
393393
f.flush()
394394
time.sleep(0.1)
395395
'''
@@ -493,7 +493,7 @@ async def test_stdio_client_nested_process_tree():
493493
grandchild_script = """import time
494494
with open({repr(grandchild_file)}, 'a') as f:
495495
while True:
496-
f.write(f"gc {{time.time()}}\\n")
496+
f.write(f"gc {time.time()}")
497497
f.flush()
498498
time.sleep(0.1)"""
499499
@@ -503,7 +503,7 @@ async def test_stdio_client_nested_process_tree():
503503
# Child writes to its file
504504
with open({repr(child_file)}, 'a') as f:
505505
while True:
506-
f.write(f"c {{time.time()}}\\n")
506+
f.write(f"c {time.time()}")
507507
f.flush()
508508
time.sleep(0.1)'''
509509
@@ -513,7 +513,7 @@ async def test_stdio_client_nested_process_tree():
513513
# Parent writes to its file
514514
with open({repr(parent_file)}, 'a') as f:
515515
while True:
516-
f.write(f"p {{time.time()}}\\n")
516+
f.write(f"p {time.time()}")
517517
f.flush()
518518
time.sleep(0.1)
519519
"""
@@ -591,7 +591,7 @@ async def test_stdio_client_early_parent_exit():
591591
child_script = f'''import time
592592
with open({repr(marker_file)}, 'a') as f:
593593
while True:
594-
f.write(f"child {{time.time()}}\\n")
594+
f.write(f"child {time.time()}")
595595
f.flush()
596596
time.sleep(0.1)'''
597597

0 commit comments

Comments
 (0)