]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
test_ftplib: silence a BytesWarning when checking TypeError
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Jul 2013 13:08:21 +0000 (15:08 +0200)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 6 Jul 2013 13:08:21 +0000 (15:08 +0200)
Lib/test/test_ftplib.py

index 6a6516517f8227f8b5721075da88c15d088d196b..dcf1fd9cff3f4456177596f4eaf68c89a70060f6 100644 (file)
@@ -590,7 +590,8 @@ class TestFTPClass(TestCase):
 
         f = io.StringIO(RETR_DATA.replace('\r\n', '\n'))
         # storlines() expects a binary file, not a text file
-        self.assertRaises(TypeError, self.client.storlines, 'stor foo', f)
+        with support.check_warnings(('', BytesWarning), quiet=True):
+            self.assertRaises(TypeError, self.client.storlines, 'stor foo', f)
 
     def test_nlst(self):
         self.client.nlst()