diff options
Diffstat (limited to 'Lib/test/test_wsgiref.py')
-rw-r--r-- | Lib/test/test_wsgiref.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index 8422b308d79..737dfed3a51 100644 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -338,6 +338,7 @@ class UtilityTests(TestCase): util.setup_testing_defaults(kw) self.assertEqual(util.request_uri(kw,query),uri) + @support.ignore_warnings(category=DeprecationWarning) def checkFW(self,text,size,match): def make_it(text=text,size=size): @@ -356,6 +357,13 @@ class UtilityTests(TestCase): it.close() self.assertTrue(it.filelike.closed) + def test_filewrapper_getitem_deprecation(self): + wrapper = util.FileWrapper(StringIO('foobar'), 3) + with self.assertWarnsRegex(DeprecationWarning, + r'Use iterator protocol instead'): + # This should have returned 'bar'. + self.assertEqual(wrapper[1], 'foo') + def testSimpleShifts(self): self.checkShift('','/', '', '/', '') self.checkShift('','/x', 'x', '/x', '') |