From 4da7656659a98c4706b1b8c66ba3fd278b1d19f7 Mon Sep 17 00:00:00 2001 From: Harshil Date: Wed, 21 Apr 2021 14:27:29 +0530 Subject: [PATCH] mark some occasionally failing tests as flaky --- tests/test_conversationhandler.py | 2 ++ tests/test_updater.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/test_conversationhandler.py b/tests/test_conversationhandler.py index f5950e6fa..3e3059c95 100644 --- a/tests/test_conversationhandler.py +++ b/tests/test_conversationhandler.py @@ -20,6 +20,7 @@ import logging from time import sleep import pytest +from flaky import flaky from telegram import ( CallbackQuery, @@ -902,6 +903,7 @@ class TestConversationHandler: assert handler.conversations.get((self.group.id, user1.id)) is None assert self.is_timeout + @flaky(3, 1) def test_conversation_timeout_keeps_extending(self, dp, bot, user1): handler = ConversationHandler( entry_points=self.entry_points, diff --git a/tests/test_updater.py b/tests/test_updater.py index b2d1c0be5..6dbe820d7 100644 --- a/tests/test_updater.py +++ b/tests/test_updater.py @@ -450,6 +450,7 @@ class TestUpdater: ) assert self.test_flag is True + @flaky(3, 1) def test_clean_deprecation_warning_webhook(self, recwarn, updater, monkeypatch): monkeypatch.setattr(updater.bot, 'set_webhook', lambda *args, **kwargs: True) monkeypatch.setattr(updater.bot, 'delete_webhook', lambda *args, **kwargs: True) @@ -465,6 +466,7 @@ class TestUpdater: assert str(recwarn[0].message).startswith('Old Handler API') assert str(recwarn[1].message).startswith('The argument `clean` of') + @flaky(3, 1) def test_clean_deprecation_warning_polling(self, recwarn, updater, monkeypatch): monkeypatch.setattr(updater.bot, 'set_webhook', lambda *args, **kwargs: True) monkeypatch.setattr(updater.bot, 'delete_webhook', lambda *args, **kwargs: True)