summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-08-29 08:35:43 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-08-29 08:35:43 (GMT)
commit50254c57cd7a562441b7ff385d59c0255301f3ff (patch)
treed9b63adc089c3e60a04668bcb22af1c706a68971 /Lib/test
parent15e6590774956a5bbb3a901bf5328869eb44ad49 (diff)
downloadcpython-50254c57cd7a562441b7ff385d59c0255301f3ff.zip
cpython-50254c57cd7a562441b7ff385d59c0255301f3ff.tar.gz
cpython-50254c57cd7a562441b7ff385d59c0255301f3ff.tar.bz2
Issue #18743: Fix references to non-existant "StringIO" module
in docstrings and comments.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/pickletester.py4
-rw-r--r--Lib/test/test_httplib.py8
-rw-r--r--Lib/test/test_logging.py7
3 files changed, 7 insertions, 12 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 3423462..052290d 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -1547,14 +1547,14 @@ class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
pickler.dump(data)
first_pickled = f.getvalue()
- # Reset StringIO object.
+ # Reset BytesIO object.
f.seek(0)
f.truncate()
pickler.dump(data)
second_pickled = f.getvalue()
- # Reset the Pickler and StringIO objects.
+ # Reset the Pickler and BytesIO objects.
pickler.clear_memo()
f.seek(0)
f.truncate()
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 863e4bc..769ab13 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -51,8 +51,8 @@ class EPipeSocket(FakeSocket):
def close(self):
pass
-class NoEOFStringIO(io.BytesIO):
- """Like StringIO, but raises AssertionError on EOF.
+class NoEOFBytesIO(io.BytesIO):
+ """Like BytesIO, but raises AssertionError on EOF.
This is used below to test that http.client doesn't try to read
more from the underlying file than it should.
@@ -324,7 +324,7 @@ class BasicTest(TestCase):
'HTTP/1.1 200 OK\r\n'
'Content-Length: 14432\r\n'
'\r\n',
- NoEOFStringIO)
+ NoEOFBytesIO)
resp = client.HTTPResponse(sock, method="HEAD")
resp.begin()
if resp.read():
@@ -337,7 +337,7 @@ class BasicTest(TestCase):
'HTTP/1.1 200 OK\r\n'
'Content-Length: 14432\r\n'
'\r\n',
- NoEOFStringIO)
+ NoEOFBytesIO)
resp = client.HTTPResponse(sock, method="HEAD")
resp.begin()
b = bytearray(5)
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index c9a051a..ae4ca18 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -156,12 +156,7 @@ class BaseTest(unittest.TestCase):
the expected_values list of tuples."""
stream = stream or self.stream
pat = re.compile(self.expected_log_pat)
- try:
- stream.reset()
- actual_lines = stream.readlines()
- except AttributeError:
- # StringIO.StringIO lacks a reset() method.
- actual_lines = stream.getvalue().splitlines()
+ actual_lines = stream.getvalue().splitlines()
self.assertEqual(len(actual_lines), len(expected_values))
for actual, expected in zip(actual_lines, expected_values):
match = pat.search(actual)