mark some occasionally failing tests as flaky

This commit is contained in:
Harshil 2021-04-21 14:27:29 +05:30
parent b63877b1f2
commit 4da7656659
No known key found for this signature in database
GPG key ID: 5AEE5B73890746C5
2 changed files with 4 additions and 0 deletions

View file

@ -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,

View file

@ -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)