Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils.TestServer.close(): unexpected keyword argument #17

Closed
garyo opened this issue Jun 1, 2018 · 6 comments
Closed

utils.TestServer.close(): unexpected keyword argument #17

garyo opened this issue Jun 1, 2018 · 6 comments

Comments

@garyo
Copy link

garyo commented Jun 1, 2018

In pytest_sanic.utils.TestServer.close(), there is this code:

            # Force close connections
            coros = []
            for conn in self.connections:
                if hasattr(conn, "websocket") and conn.websocket:
>                   coros.append(conn.websocket.close_connection(after_handshake=False))
E                   TypeError: close_connection() got an unexpected keyword argument 'after_handshake'

As you can see from the E error here, conn.websocket.close_connection() doesn't expect an after_handshake arg.

@yunstanford
Copy link
Owner

@garyo Thanks for bringing up this. looks like because of incompatible change in websockets, they've bumped up version to 5.0 recently.

Also we also have to fix Sanic here, https://github.com/channelcat/sanic/blob/master/sanic/server.py#L668, I'll fix both soon.

To quick unblock yourself, you can use websockets < 5.0

@garyo
Copy link
Author

garyo commented Jun 1, 2018

Actually I just locally edited utils.py 😄 and removed the extra arg. Thanks for the quick response!

@yunstanford
Copy link
Owner

@garyo i've pushed a fix in Sanic, master branch. but it requires a release. or you can use master branch.

@garyo
Copy link
Author

garyo commented Jul 25, 2018

Sanic is now updated to require websockets 5.0, so this failure is is back.

@yunstanford
Copy link
Owner

Yeah, but Sanic didn't release the latest version to pypi. Anyway, I guess I can push a fix for both case.

@yunstanford
Copy link
Owner

ok, fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants