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

fix test_client connected error #1829

Closed
wants to merge 3 commits into from
Closed

fix test_client connected error #1829

wants to merge 3 commits into from

Conversation

shinoi2
Copy link

@shinoi2 shinoi2 commented Jun 10, 2022

The server disconnects all clients, only one testclient will disconnect.

The server disconnects all clients, only one testclient will disconnect.
When disconnecting, messages before disconnection can not received.
@miguelgrinberg
Copy link
Owner

I don't understand what is the issue that this change addresses. Can you provide an example please?

@shinoi2
Copy link
Author

shinoi2 commented Jun 11, 2022

I add an example in test.

@codecov-commenter
Copy link

Codecov Report

Merging #1829 (d2c1f64) into main (e35a0f4) will decrease coverage by 0.59%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1829      +/-   ##
==========================================
- Coverage   79.24%   78.64%   -0.60%     
==========================================
  Files           3        3              
  Lines         371      370       -1     
  Branches       73       72       -1     
==========================================
- Hits          294      291       -3     
- Misses         56       59       +3     
+ Partials       21       20       -1     
Impacted Files Coverage Δ
src/flask_socketio/test_client.py 93.68% <100.00%> (+2.01%) ⬆️
src/flask_socketio/__init__.py 73.43% <0.00%> (-1.57%) ⬇️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@@ -237,7 +237,7 @@ def on_json(self, data):
return data

def on_exit(self, data):
disconnect()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change seems unrelated

@@ -203,8 +204,6 @@ def get_received(self, namespace=None):
namespace is assumed if this argument is not
provided.
"""
if not self.is_connected(namespace):
raise RuntimeError('not connected')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

@miguelgrinberg
Copy link
Owner

Thanks, I do understand the problem now. I have addressed in a slightly different way.

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

Successfully merging this pull request may close these issues.

None yet

3 participants