From f49897cd5b63bd1b643929845873f23fb686cc5f Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Thu, 30 Oct 2025 18:33:12 +0100 Subject: [PATCH] =?UTF-8?q?Test=20sur=20les=20tirages=20au=20sort=20r?= =?UTF-8?q?=C3=A9par=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- draw/tests.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/draw/tests.py b/draw/tests.py index e495697..9af7edc 100644 --- a/draw/tests.py +++ b/draw/tests.py @@ -1,6 +1,5 @@ # Copyright (C) 2023 by Animath # SPDX-License-Identifier: GPL-3.0-or-later -import asyncio from random import shuffle from asgiref.sync import sync_to_async @@ -712,15 +711,12 @@ class TestDraw(TestCase): {'tid': tid, 'type': 'export_visibility', 'visible': False}) # Cancel all steps and reset all - for i in range(1000): + for i in range(150): await communicator.send_json_to({'tid': tid, 'type': 'cancel'}) # Purge receive queue - while True: - try: - await communicator.receive_json_from() - except asyncio.TimeoutError: - break + while (await communicator.receive_json_from())['type'] != "abort": + pass if await Draw.objects.filter(tournament_id=tid).aexists(): print((await Draw.objects.filter(tournament_id=tid).aexists()))