You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by LostInDarkMath June 27, 2021 Describe the bug
I just included Flask-SocketIO in my project which is based on Flask-SQLAlchemy and wrote some tests. But I in a simple test I get the following error:
sqlalchemy.orm.exc.DetachedInstanceError: Instance <User at 0x2812f970> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/14/bhk3)
The error causing test can be reduced to the following:
deftest_receive_notifications_on_new_message_via_websockets(self) ->None:
socketio_client=self.socketio.test_client(app=self.app, flask_test_client=self.client, headers=self.header())
self._send_message(sender=self.dummy2, receiver=self.dummy) # it fails here
If I comment out the the first line that creates the socketio test client, the errors does not appear. This is quite strange because I have no idea why the creation of socketio test client can lead to detached instances.
The text was updated successfully, but these errors were encountered:
Discussed in #1616
Originally posted by LostInDarkMath June 27, 2021
Describe the bug
I just included
Flask-SocketIO
in my project which is based onFlask-SQLAlchemy
and wrote some tests. But I in a simple test I get the following error:The error causing test can be reduced to the following:
If I comment out the the first line that creates the socketio test client, the errors does not appear. This is quite strange because I have no idea why the creation of socketio test client can lead to detached instances.
The text was updated successfully, but these errors were encountered: