Skip to content

Commit 60b0fa3

Browse files
committed
whitespace
1 parent 57bf872 commit 60b0fa3

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Lib/test/test_asyncio/test_events.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2990,7 +2990,7 @@ def tearDown(self):
29902990

29912991
def test_py_set_running_loop_c_get_sync(self):
29922992
"""Test that _py_set_running_loop synchronizes with C _get_running_loop.
2993-
2993+
29942994
This verifies that when Python sets the running loop, both Python
29952995
and C implementations can retrieve it correctly.
29962996
"""
@@ -3022,13 +3022,13 @@ def test_py_set_running_loop_c_get_sync(self):
30223022
self.assertIsNone(c_get())
30233023

30243024
test_loop.close()
3025-
3025+
30263026
finally:
30273027
events._set_running_loop(old_running_loop)
30283028

30293029
def test_c_set_running_loop_py_get_sync(self):
30303030
"""Test that C _set_running_loop synchronizes with _py_get_running_loop.
3031-
3031+
30323032
This verifies that when C sets the running loop, both C and Python
30333033
implementations can retrieve it correctly.
30343034
"""
@@ -3078,11 +3078,11 @@ async def main():
30783078
# This demonstrates the C/Python task sync problem
30793079
try:
30803080
current = asyncio.current_task()
3081-
self.assertIsNotNone(current,
3081+
self.assertIsNotNone(current,
30823082
"current_task() should not return None when called from _PyTask")
30833083
except RuntimeError as e:
30843084
self.fail(f"current_task() failed when called from _PyTask: {e}")
3085-
3085+
30863086
if multiprocessing.get_start_method() == 'fork':
30873087
# Avoid 'fork' DeprecationWarning.
30883088
mp_context = multiprocessing.get_context('forkserver')

Lib/test/test_asyncio/test_tasks.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3726,17 +3726,17 @@ def tearDown(self):
37263726
finally:
37273727
self.loop.close()
37283728
asyncio.set_event_loop(None)
3729-
3729+
37303730
async def _test_coro(self):
37313731
# Get the current task - this should not return None
37323732
current = asyncio.current_task()
37333733
self.assertIsNotNone(current, "current_task() should not return None")
37343734
return current
3735-
3735+
37363736

37373737
def current_task(self, eager=False):
37383738
"""Test that current_task() works correctly with _PyTask
3739-
3739+
37403740
This is a regression test for an issue where current_task() would return
37413741
None when called from within a _PyTask
37423742
The issue was caused by incomplete synchronization between the C and
@@ -3758,38 +3758,38 @@ def test_current_task(self):
37583758

37593759
def test_current_task_consistency_after_task_switch(self):
37603760
"""Test that current_task() remains consistent during task switching.
3761-
3761+
37623762
This tests the synchronization between C and Python implementations
37633763
when tasks are swapped in and out of execution.
37643764
"""
37653765
results = []
3766-
3766+
37673767
async def task_a():
37683768
results.append(('task_a_start', asyncio.current_task()))
37693769
await asyncio.sleep(0) # Yield control
37703770
results.append(('task_a_end', asyncio.current_task()))
37713771
return "A"
3772-
3772+
37733773
async def task_b():
37743774
results.append(('task_b_start', asyncio.current_task()))
3775-
await asyncio.sleep(0) # Yield control
3775+
await asyncio.sleep(0) # Yield control
37763776
results.append(('task_b_end', asyncio.current_task()))
37773777
return "B"
3778-
3778+
37793779
async def main():
37803780
# Start both tasks concurrently
37813781
a = self.Task(task_a())
37823782
b = self.Task(task_b())
3783-
3783+
37843784
return await asyncio.gather(a, b)
3785-
3785+
37863786
result = self.loop.run_until_complete(main())
37873787
self.assertEqual(result, ["A", "B"])
3788-
3788+
37893789
# Verify that current_task() was never None and was consistent
37903790
for label, current_task in results:
37913791
self.assertIsNotNone(current_task, f"current_task() was None at {label}")
3792-
3792+
37933793
# Verify we got results from both tasks
37943794
task_a_results = [r for r in results if r[0].startswith('task_a')]
37953795
task_b_results = [r for r in results if r[0].startswith('task_b')]

0 commit comments

Comments
 (0)