Skip to content

Commit

Permalink
WIP fix#2525
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Barra committed Nov 17, 2017
1 parent d6426ad commit 0969027
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aiohttp/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from yarl import URL

import aiohttp
from aiohttp.client import _RequestContextManager
from aiohttp.client import _RequestContextManager, _WSRequestContextManager

from . import ClientSession, hdrs
from .helpers import sentinel
Expand Down Expand Up @@ -278,12 +278,16 @@ def delete(self, path, *args, **kwargs):
self.request(hdrs.METH_DELETE, path, *args, **kwargs)
)

async def ws_connect(self, path, *args, **kwargs):
def ws_connect(self, path, *args, **kwargs):
"""Initiate websocket connection.
The api corresponds to aiohttp.ClientSession.ws_connect.
"""
return _WSRequestContextManager(
self._ws_connect(path), *args, **kwargs)

async def _ws_connect(self, path, *args, **kwargs):
ws = await self._session.ws_connect(
self.make_url(path), *args, **kwargs)
self._websockets.append(ws)
Expand Down

0 comments on commit 0969027

Please sign in to comment.