#2353: raise Py3k warning in file.xreadlines().

This commit is contained in:
Georg Brandl 2008-05-17 22:11:54 +00:00
parent c76ffca2be
commit a9916b55de
3 changed files with 21 additions and 3 deletions

View file

@ -123,6 +123,13 @@ class TestPy3KWarnings(unittest.TestCase):
with catch_warning() as w:
self.assertWarning(buffer('a'), w, expected)
def test_file_xreadlines(self):
expected = ("f.xreadlines() not supported in 3.x, "
"try 'for line in f' instead")
with file(__file__) as f:
with catch_warning() as w:
self.assertWarning(f.xreadlines(), w, expected)
class TestStdlibRemovals(unittest.TestCase):