Skip to content

Commit

Permalink
Add delay to test to avoid timing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Oct 15, 2023
1 parent 2c1c712 commit 57d40f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test_socketio.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import time
import unittest

from flask import Flask, session, request, json as flask_json
Expand Down Expand Up @@ -773,6 +774,7 @@ def test_encode_decode_2(self):
def test_background_task(self):
client = socketio.test_client(app, namespace='/bgtest')
self.assertTrue(client.is_connected(namespace='/bgtest'))
time.sleep(0.1)
received = client.get_received('/bgtest')
self.assertEqual(len(received), 1)
self.assertEqual(received[0]['name'], 'bgtest')
Expand Down

0 comments on commit 57d40f9

Please sign in to comment.