summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
committerGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
commitab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch)
tree6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_io.py
parentef82be368abdea8e8032500e7ecc3a22f5f07851 (diff)
downloadcpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r--Lib/test/test_io.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 407a8a4..a9094d9 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -391,7 +391,7 @@ class IOTest(unittest.TestCase):
with self.open(support.TESTFN, "ab") as f:
self.assertEqual(f.tell(), 3)
with self.open(support.TESTFN, "a") as f:
- self.assert_(f.tell() > 0)
+ self.assertTrue(f.tell() > 0)
def test_destructor(self):
record = []
@@ -509,7 +509,7 @@ class IOTest(unittest.TestCase):
wr = weakref.ref(f)
del f
support.gc_collect()
- self.assert_(wr() is None, wr)
+ self.assertTrue(wr() is None, wr)
with self.open(support.TESTFN, "rb") as f:
self.assertEqual(f.read(), b"abcxxx")
@@ -615,8 +615,8 @@ class CommonBufferedTests:
if s:
# The destructor *may* have printed an unraisable error, check it
self.assertEqual(len(s.splitlines()), 1)
- self.assert_(s.startswith("Exception IOError: "), s)
- self.assert_(s.endswith(" ignored"), s)
+ self.assertTrue(s.startswith("Exception IOError: "), s)
+ self.assertTrue(s.endswith(" ignored"), s)
def test_repr(self):
raw = self.MockRawIO()
@@ -713,7 +713,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
self.assertEquals(b"e", bufio.read(1))
self.assertEquals(b"fg", bufio.read())
self.assertEquals(b"", bufio.peek(1))
- self.assert_(None is bufio.read())
+ self.assertTrue(None is bufio.read())
self.assertEquals(b"", bufio.read())
def test_read_past_eof(self):
@@ -815,7 +815,7 @@ class CBufferedReaderTest(BufferedReaderTest):
wr = weakref.ref(f)
del f
support.gc_collect()
- self.assert_(wr() is None, wr)
+ self.assertTrue(wr() is None, wr)
class PyBufferedReaderTest(BufferedReaderTest):
tp = pyio.BufferedReader
@@ -864,7 +864,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
flushed = b"".join(writer._write_stack)
# At least (total - 8) bytes were implicitly flushed, perhaps more
# depending on the implementation.
- self.assert_(flushed.startswith(contents[:-8]), flushed)
+ self.assertTrue(flushed.startswith(contents[:-8]), flushed)
def check_writes(self, intermediate_func):
# Lots of writes, test the flushed output is as expected.
@@ -1075,7 +1075,7 @@ class CBufferedWriterTest(BufferedWriterTest):
wr = weakref.ref(f)
del f
support.gc_collect()
- self.assert_(wr() is None, wr)
+ self.assertTrue(wr() is None, wr)
with self.open(support.TESTFN, "rb") as f:
self.assertEqual(f.read(), b"123xxx")
@@ -1585,7 +1585,7 @@ class TextIOWrapperTest(unittest.TestCase):
t = self.TextIOWrapper(b, encoding="utf8")
self.assertEqual(t.encoding, "utf8")
t = self.TextIOWrapper(b)
- self.assert_(t.encoding is not None)
+ self.assertTrue(t.encoding is not None)
codecs.lookup(t.encoding)
def test_encoding_errors_reading(self):
@@ -1755,8 +1755,8 @@ class TextIOWrapperTest(unittest.TestCase):
if s:
# The destructor *may* have printed an unraisable error, check it
self.assertEqual(len(s.splitlines()), 1)
- self.assert_(s.startswith("Exception IOError: "), s)
- self.assert_(s.endswith(" ignored"), s)
+ self.assertTrue(s.startswith("Exception IOError: "), s)
+ self.assertTrue(s.endswith(" ignored"), s)
# Systematic tests of the text I/O API
@@ -2074,7 +2074,7 @@ class CTextIOWrapperTest(TextIOWrapperTest):
wr = weakref.ref(t)
del t
support.gc_collect()
- self.assert_(wr() is None, wr)
+ self.assertTrue(wr() is None, wr)
with self.open(support.TESTFN, "rb") as f:
self.assertEqual(f.read(), b"456def")
@@ -2298,7 +2298,7 @@ class MiscIOTest(unittest.TestCase):
wr = weakref.ref(c)
del c, b
support.gc_collect()
- self.assert_(wr() is None, wr)
+ self.assertTrue(wr() is None, wr)
def test_abcs(self):
# Test the visible base classes are ABCs.