Skip to content

Commit bcec499

Browse files
committed
yapf
1 parent 1768aea commit bcec499

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

trio/tests/test_threads.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def f(record):
5454
record.append(("f", threading.current_thread()))
5555
raise ValueError
5656

57-
await check_case(from_thread_run_sync, f, ("error", ValueError), trio_token=token)
57+
await check_case(
58+
from_thread_run_sync, f, ("error", ValueError), trio_token=token
59+
)
5860

5961
async def f(record):
6062
assert not _core.currently_ki_protected()
@@ -503,7 +505,9 @@ async def test_trio_from_thread_token_kwarg():
503505
# Test that to_thread_run_sync and spawned trio.from_thread.run_sync() can
504506
# use an explicitly defined token
505507
def thread_fn(token):
506-
callee_token = from_thread_run_sync(_core.current_trio_token, trio_token=token)
508+
callee_token = from_thread_run_sync(
509+
_core.current_trio_token, trio_token=token
510+
)
507511
return callee_token
508512

509513
caller_token = _core.current_trio_token()
@@ -521,7 +525,9 @@ async def test_from_thread_no_token():
521525

522526
def test_run_fn_as_system_task_catched_badly_typed_token():
523527
with pytest.raises(RuntimeError):
524-
from_thread_run_sync(_core.current_time, trio_token="Not TrioTokentype")
528+
from_thread_run_sync(
529+
_core.current_time, trio_token="Not TrioTokentype"
530+
)
525531

526532

527533
async def test_do_in_trio_thread_from_trio_thread_legacy():

trio/tests/test_wait_for_object.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ async def test_WaitForMultipleObjects_sync_slow():
9797
t0 = _core.current_time()
9898
async with _core.open_nursery() as nursery:
9999
nursery.start_soon(
100-
trio.to_thread.run_sync, WaitForMultipleObjects_sync, handle1, handle2
100+
trio.to_thread.run_sync, WaitForMultipleObjects_sync, handle1,
101+
handle2
101102
)
102103
await _timeouts.sleep(TIMEOUT)
103104
kernel32.SetEvent(handle1)
@@ -113,7 +114,8 @@ async def test_WaitForMultipleObjects_sync_slow():
113114
t0 = _core.current_time()
114115
async with _core.open_nursery() as nursery:
115116
nursery.start_soon(
116-
trio.to_thread.run_sync, WaitForMultipleObjects_sync, handle1, handle2
117+
trio.to_thread.run_sync, WaitForMultipleObjects_sync, handle1,
118+
handle2
117119
)
118120
await _timeouts.sleep(TIMEOUT)
119121
kernel32.SetEvent(handle2)

0 commit comments

Comments
 (0)