From 57d40f934aa5a35649a15122d87b77a4024cf08d Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Sun, 15 Oct 2023 14:28:34 +0100 Subject: [PATCH] Add delay to test to avoid timing errors --- test_socketio.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test_socketio.py b/test_socketio.py index 075424a..7223dc5 100644 --- a/test_socketio.py +++ b/test_socketio.py @@ -1,4 +1,5 @@ import json +import time import unittest from flask import Flask, session, request, json as flask_json @@ -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')