diff --git a/socketio/asyncio_namespace.py b/socketio/asyncio_namespace.py index e3768755..12e9c0fe 100644 --- a/socketio/asyncio_namespace.py +++ b/socketio/asyncio_namespace.py @@ -192,7 +192,7 @@ async def send(self, data, namespace=None, callback=None): namespace=namespace or self.namespace, callback=callback) - async def disconnect(self, namespace=None): + async def disconnect(self): """Disconnect a client. The only difference with the :func:`socketio.Client.disconnect` method @@ -201,5 +201,4 @@ async def disconnect(self, namespace=None): Note: this method is a coroutine. """ - return await self.client.disconnect( - namespace=namespace or self.namespace) + return await self.client.disconnect() diff --git a/socketio/namespace.py b/socketio/namespace.py index 30ab1bf1..418615ff 100644 --- a/socketio/namespace.py +++ b/socketio/namespace.py @@ -181,11 +181,11 @@ def send(self, data, room=None, skip_sid=None, namespace=None, return self.client.send(data, namespace=namespace or self.namespace, callback=callback) - def disconnect(self, namespace=None): + def disconnect(self): """Disconnect from the server. The only difference with the :func:`socketio.Client.disconnect` method is that when the ``namespace`` argument is not given the namespace associated with the class is used. """ - return self.client.disconnect(namespace=namespace or self.namespace) + return self.client.disconnect() diff --git a/tests/asyncio/test_asyncio_namespace.py b/tests/asyncio/test_asyncio_namespace.py index c3a31785..29164536 100644 --- a/tests/asyncio/test_asyncio_namespace.py +++ b/tests/asyncio/test_asyncio_namespace.py @@ -257,6 +257,4 @@ def test_disconnect_client(self): mock_client.disconnect = AsyncMock() ns._set_client(mock_client) _run(ns.disconnect()) - ns.client.disconnect.mock.assert_called_with(namespace='/foo') - _run(ns.disconnect(namespace='/bar')) - ns.client.disconnect.mock.assert_called_with(namespace='/bar') + ns.client.disconnect.mock.assert_called_with() diff --git a/tests/common/test_namespace.py b/tests/common/test_namespace.py index b07e8209..10eba66b 100644 --- a/tests/common/test_namespace.py +++ b/tests/common/test_namespace.py @@ -170,6 +170,4 @@ def test_disconnect_client(self): ns = namespace.ClientNamespace('/foo') ns._set_client(mock.MagicMock()) ns.disconnect() - ns.client.disconnect.assert_called_with(namespace='/foo') - ns.disconnect(namespace='/bar') - ns.client.disconnect.assert_called_with(namespace='/bar') + ns.client.disconnect.assert_called_with()