From b040568b072b5d64fefb308faa71f6d103ad2b74 Mon Sep 17 00:00:00 2001 From: Noam Meltzer Date: Mon, 30 May 2016 00:46:42 +0300 Subject: [PATCH] test_bot: fix for urllib3 compatibility --- tests/test_bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_bot.py b/tests/test_bot.py index db26e330f..5b59b990f 100644 --- a/tests/test_bot.py +++ b/tests/test_bot.py @@ -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)