mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-21 22:56:38 +01:00
test_bot: fix for urllib3 compatibility
This commit is contained in:
parent
3076dfc086
commit
b040568b07
1 changed files with 4 additions and 2 deletions
|
@ -20,6 +20,7 @@
|
|||
"""This module contains a object that represents Tests for Telegram Bot"""
|
||||
|
||||
import io
|
||||
import re
|
||||
from datetime import datetime
|
||||
import sys
|
||||
|
||||
|
@ -211,10 +212,11 @@ class BotTest(BaseTest, unittest.TestCase):
|
|||
@flaky(3, 1)
|
||||
@timeout(10)
|
||||
def testLeaveChat(self):
|
||||
with self.assertRaisesRegexp(telegram.error.BadRequest, 'Chat not found'):
|
||||
regex = re.compile('chat not found', re.IGNORECASE)
|
||||
with self.assertRaisesRegexp(telegram.error.BadRequest, regex):
|
||||
chat = self._bot.leaveChat(-123456)
|
||||
|
||||
with self.assertRaisesRegexp(telegram.error.NetworkError, 'Chat not found'):
|
||||
with self.assertRaisesRegexp(telegram.error.NetworkError, regex):
|
||||
chat = self._bot.leaveChat(-123456)
|
||||
|
||||
@flaky(3, 1)
|
||||
|
|
Loading…
Reference in a new issue