Skip to content

Commit a737eea

Browse files
committed
lint fixes
1 parent 03c2d4b commit a737eea

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/test_connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ async def wrapper(*args, **kwargs):
127127
class MemoryListener(trio.abc.Listener):
128128
closed = attr.ib(default=False)
129129
accepted_streams = attr.ib(factory=list)
130-
queued_streams = attr.ib(factory=(lambda: trio.open_memory_channel(1)))
130+
queued_streams = attr.ib(factory=lambda: trio.open_memory_channel(1))
131131
accept_hook = attr.ib(default=None)
132132

133133
async def connect(self):
@@ -423,10 +423,10 @@ async def test_handshake_exception_before_accept():
423423
handshake causes the task to hang. The proper behavior is to raise an
424424
exception to the nursery as soon as possible. '''
425425
async def handler(request):
426-
raise Exception()
426+
raise ValueError()
427427

428-
with pytest.raises(Exception):
429-
with trio.open_nursery() as nursery:
428+
with pytest.raises(ValueError):
429+
async with trio.open_nursery() as nursery:
430430
server = await nursery.start(serve_websocket, handler, HOST, 0,
431431
None)
432432
async with open_websocket(HOST, server.port, RESOURCE,

trio_websocket/_impl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __exit__(self, ty, value, tb):
6262
def remove_cancels(exc):
6363
return None if isinstance(exc, trio.Cancelled) else exc
6464

65-
return trio.MultiError.filter(remove_cancels, value) is None
65+
return trio.MultiError.filter(remove_cancels, value) is None # pylint: disable=no-member
6666

6767

6868
@asynccontextmanager
@@ -1027,9 +1027,9 @@ async def _get_request(self):
10271027
:rtype: WebSocketRequest
10281028
'''
10291029
if not self.is_server:
1030-
raise Exception('This method is only valid for server connections.')
1030+
raise RuntimeError('This method is only valid for server connections.')
10311031
if self._connection_proposal is None:
1032-
raise Exception('No proposal available. Did you call this method'
1032+
raise RuntimeError('No proposal available. Did you call this method'
10331033
' multiple times or at the wrong time?')
10341034
proposal = await self._connection_proposal.wait_value()
10351035
self._connection_proposal = None

0 commit comments

Comments
 (0)