Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update test_io_threading.py to not suffer from interleaved prints
  • Loading branch information
elistevens authored May 30, 2024
commit d156d3c73dca08032ffa0e6b8edc1080bebdcb38
4 changes: 2 additions & 2 deletions Lib/test/test_io_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def looping_print_to_file(f, i):
for j in range(NUM_LOOPS):
# p = 'x' * 90 + '123456789'
p = f"{i:2}i,{j}j\n" + '0123456789' * 10
p = f"\n{i}i,{j}j\n" + '0123456789' * 10
print(p, file=f)

class IoThreadingTestCase(unittest.TestCase):
Expand All @@ -27,7 +27,7 @@ def test_io_threading(self):

for i in range(NUM_THREADS):
for j in range(NUM_LOOPS):
p = f"{i:2}i,{j}j"
p = f"{i}i,{j}j"

assert p in lines, repr(p)

Expand Down