[Python-checkins] cpython (3.3): test_ftplib: silence a BytesWarning when checking TypeError

florent.xicluna python-checkins at python.org
Sat Jul 6 15:08:51 CEST 2013


http://hg.python.org/cpython/rev/851254748c6b
changeset:   84460:851254748c6b
branch:      3.3
parent:      84458:27eb350d5056
user:        Florent Xicluna <florent.xicluna at gmail.com>
date:        Sat Jul 06 15:08:21 2013 +0200
summary:
  test_ftplib: silence a BytesWarning when checking TypeError

files:
  Lib/test/test_ftplib.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -590,7 +590,8 @@
 
         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()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list