Skip to content

Test failure when upgrading from 4.3.1 to 4.4.0 #385

@matthewwillian

Description

@matthewwillian

Coming from usage of Flask-SocketIO.

from api.sockets import socket_io

def test_socketio(app, app_test_client):
    """Test that SocketIO connects."""
    socketio_test_client = socket_io.test_client(
        app, flask_test_client=app_test_client
    )
    assert not socketio_test_client.is_connected()

the namespace is defined as follows:

from flask_socketio import Namespace, SocketIO

from api.context import get_user

socket_io = SocketIO()  # SocketIO server - initialized within app init


class RootNamespace(Namespace):

    def on_connect(self):
        """Event handler for connecting to a namespace."""
        return get_user() is not None


socket_io.on_namespace(RootNamespace("/"))

this unit test fails against 4.4.0 but passes against 4.3.1. did the behavior of on_connect get indirectly changed by this version bump?

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions