Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Feb 20, 2017
1 parent 5440660 commit 8e7e286
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sockjs/transports/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import aiohttp
import asyncio
from aiohttp import errors

from ..exceptions import SessionIsAcquired, SessionIsClosed
from ..protocol import close_frame, ENCODING
Expand Down Expand Up @@ -78,7 +78,7 @@ def handle_session(self):
break
except asyncio.CancelledError:
yield from self.session._remote_close(
exc=errors.ClientDisconnectedError)
exc=aiohttp.ClientConnectionError)
yield from self.session._remote_closed()
raise
except SessionIsClosed:
Expand Down
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from sockjs import Session, SessionManager, transports
from sockjs.route import SockJSRoute

pytest_plugins = 'aiohttp.pytest_plugin'


@pytest.fixture
def app(loop):
Expand Down Expand Up @@ -82,7 +84,7 @@ def maker(method, path, query_params={}, headers=None,
'SEC-WEBSOCKET-PROTOCOL': 'chat, superchat',
'SEC-WEBSOCKET-VERSION': '13'})

ret = make_mocked_request(method, path, headers)
ret = make_mocked_request(method, str(path), headers)
if match_info is None:
match_info = UrlMappingMatchInfo({}, mock.Mock())
match_info.add_app(app)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_route.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio

from aiohttp import web
from aiohttp import CIMultiDict
from multidict import CIMultiDict

from sockjs import protocol

Expand Down

0 comments on commit 8e7e286

Please sign in to comment.