Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_bytes.py @ 41455:5dfd2f4bc834
Support name and mode attributes on all file types.
Don't read more than one line when reading text from a tty device.
Add peek() and read1() methods.
Return str instead of unicode when return ASCII characters in text mode.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 13 Apr 2007 18:42:35 +0000 |
| parents | e2d7a4c39360 |
| children | beacf40b5960 |
line wrap: on
line diff
--- a/Lib/test/test_bytes.py Fri Apr 13 03:33:53 2007 +0000 +++ b/Lib/test/test_bytes.py Fri Apr 13 18:42:35 2007 +0000 @@ -163,14 +163,7 @@ f.write(b) with open(tfn, "rb") as f: self.assertEqual(f.read(), sample) - # Test writing in text mode - with open(tfn, "w") as f: - f.write(b) - with open(tfn, "r") as f: - self.assertEqual(f.read(), sample) - # Can't use readinto in text mode - with open(tfn, "r") as f: - self.assertRaises(TypeError, f.readinto, b) + # Text mode is ambiguous; don't test finally: try: os.remove(tfn)
