Skip to content

Commit

Permalink
Run yapf
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Jan 19, 2018
1 parent 1f723ac commit 5b2ffe2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 4 additions & 6 deletions trio/_core/tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ async def main():
with pytest.raises(_core.MultiError) as excinfo:
_core.run(main)
print(excinfo.value)
assert set(type(exc) for exc in excinfo.value.exceptions) == {
ValueError, KeyError
}
assert set(type(exc)
for exc in excinfo.value.exceptions) == {ValueError, KeyError}


def test_two_child_crashes():
Expand All @@ -201,9 +200,8 @@ async def main():

with pytest.raises(_core.MultiError) as excinfo:
_core.run(main)
assert set(type(exc) for exc in excinfo.value.exceptions) == {
ValueError, KeyError
}
assert set(type(exc)
for exc in excinfo.value.exceptions) == {ValueError, KeyError}


async def test_child_crash_wakes_parent():
Expand Down
4 changes: 2 additions & 2 deletions trio/_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ async def _resolve_address(self, address, flags):
if not self._sock.getsockopt(IPPROTO_IPV6, IPV6_V6ONLY):
flags |= AI_V4MAPPED
gai_res = await getaddrinfo(
host, port, self._sock.family,
real_socket_type(self._sock.type), self._sock.proto, flags
host, port, self._sock.family, real_socket_type(self._sock.type),
self._sock.proto, flags
)
# AFAICT from the spec it's not possible for getaddrinfo to return an
# empty list.
Expand Down
4 changes: 2 additions & 2 deletions trio/_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def __init__(self, total_tokens):
def __repr__(self):
return (
"<trio.CapacityLimiter at {:#x}, {}/{} with {} waiting>".format(
id(self),
len(self._borrowers), self._total_tokens, len(self._lot)
id(self), len(self._borrowers), self._total_tokens,
len(self._lot)
)
)

Expand Down
6 changes: 3 additions & 3 deletions trio/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ async def __aexit__(self, type, value, traceback):
# was passed to throw() and later wrapped into a RuntimeError
# (see PEP 479).
if (
isinstance(value,
(StopIteration, StopAsyncIteration))
and exc.__cause__ is value
isinstance(value,
(StopIteration, StopAsyncIteration))
and exc.__cause__ is value
):
return False
raise
Expand Down
2 changes: 2 additions & 0 deletions trio/testing/_check_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ async def receive_send_then_close():
# we can't do it here. Maybe we could do a bit better with
# https://github.com/python-trio/trio/issues/77
async with _ForceCloseBoth(await stream_maker()) as (s, r):

async def expect_cancelled(afn, *args):
with _assert_raises(_core.Cancelled):
await afn(*args)
Expand Down Expand Up @@ -315,6 +316,7 @@ async def receiver():

# closing the receiver causes wait_send_all_might_not_block to return
async with _ForceCloseBoth(await clogged_stream_maker()) as (s, r):

async def sender():
try:
with assert_checkpoints():
Expand Down

0 comments on commit 5b2ffe2

Please sign in to comment.