diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_calendar.py | 2 | ||||
-rw-r--r-- | Lib/test/test_email/__init__.py | 2 | ||||
-rw-r--r-- | Lib/test/test_gzip.py | 4 | ||||
-rw-r--r-- | Lib/test/test_inspect.py | 2 | ||||
-rw-r--r-- | Lib/test/test_io.py | 4 | ||||
-rw-r--r-- | Lib/test/test_nntplib.py | 4 | ||||
-rw-r--r-- | Lib/test/test_pydoc.py | 4 | ||||
-rw-r--r-- | Lib/test/test_tokenize.py | 2 |
8 files changed, 12 insertions, 12 deletions
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index d3093ac..7180afe 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -177,7 +177,7 @@ class OutputTestCase(unittest.TestCase): return not c.isspace() and not c.isdigit() lines = [] - for line in s.splitlines(False): + for line in s.splitlines(keepends=False): # Drop texts, as they are locale dependent if line and not filter(neitherspacenordigit, line): lines.append(line) diff --git a/Lib/test/test_email/__init__.py b/Lib/test/test_email/__init__.py index 04fdf89..280afbd 100644 --- a/Lib/test/test_email/__init__.py +++ b/Lib/test/test_email/__init__.py @@ -38,7 +38,7 @@ class TestEmailBase(unittest.TestCase): return email.message_from_file(fp) def _bytes_repr(self, b): - return [repr(x) for x in b.splitlines(True)] + return [repr(x) for x in b.splitlines(keepends=True)] def assertBytesEqual(self, first, second, msg): """Our byte strings are really encoded strings; improve diff output""" diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 3ea5c41..9c7a96e 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -139,7 +139,7 @@ class TestGzip(unittest.TestCase): with io.BufferedReader(f) as r: lines = [line for line in r] - self.assertEqual(lines, 50 * data1.splitlines(True)) + self.assertEqual(lines, 50 * data1.splitlines(keepends=True)) def test_readline(self): self.test_write() @@ -340,7 +340,7 @@ class TestGzip(unittest.TestCase): def test_textio_readlines(self): # Issue #10791: TextIOWrapper.readlines() fails when wrapping GzipFile. - lines = (data1 * 50).decode("ascii").splitlines(True) + lines = (data1 * 50).decode("ascii").splitlines(keepends=True) self.test_write() with gzip.GzipFile(self.filename, 'r') as f: with io.TextIOWrapper(f, encoding="ascii") as t: diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 7666fe4..06132f2 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -304,7 +304,7 @@ class TestRetrievingSourceCode(GetSourceBase): getlines = linecache.getlines def monkey(filename, module_globals=None): if filename == fn: - return source.splitlines(True) + return source.splitlines(keepends=True) else: return getlines(filename, module_globals) linecache.getlines = monkey diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 2c502ab..117f8ab 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -1935,8 +1935,8 @@ class TextIOWrapperTest(unittest.TestCase): testdata = b"AAA\nBB\x00B\nCCC\rDDD\rEEE\r\nFFF\r\nGGG" normalized = testdata.replace(b"\r\n", b"\n").replace(b"\r", b"\n") for newline, expected in [ - (None, normalized.decode("ascii").splitlines(True)), - ("", testdata.decode("ascii").splitlines(True)), + (None, normalized.decode("ascii").splitlines(keepends=True)), + ("", testdata.decode("ascii").splitlines(keepends=True)), ("\n", ["AAA\n", "BB\x00B\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), ("\r\n", ["AAA\nBB\x00B\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]), ("\r", ["AAA\nBB\x00B\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]), diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index ec790ad..d8e6332 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -1033,12 +1033,12 @@ class NNTPv1v2TestsMixin: self.assertEqual(resp, success_resp) # With an iterable of terminated lines def iterlines(b): - return iter(b.splitlines(True)) + return iter(b.splitlines(keepends=True)) resp = self._check_post_ihave_sub(func, *args, file_factory=iterlines) self.assertEqual(resp, success_resp) # With an iterable of non-terminated lines def iterlines(b): - return iter(b.splitlines(False)) + return iter(b.splitlines(keepends=False)) resp = self._check_post_ihave_sub(func, *args, file_factory=iterlines) self.assertEqual(resp, success_resp) diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index ae56996..6d3923f 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -238,8 +238,8 @@ def get_pydoc_text(module): def print_diffs(text1, text2): "Prints unified diffs for two texts" # XXX now obsolete, use unittest built-in support - lines1 = text1.splitlines(True) - lines2 = text2.splitlines(True) + lines1 = text1.splitlines(keepends=True) + lines2 = text2.splitlines(keepends=True) diffs = difflib.unified_diff(lines1, lines2, n=0, fromfile='expected', tofile='got') print('\n' + ''.join(diffs)) diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 9e9656c..af2bbf1 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -600,7 +600,7 @@ def roundtrip(f): f.close() tokens1 = [tok[:2] for tok in token_list] new_bytes = untokenize(tokens1) - readline = (line for line in new_bytes.splitlines(1)).__next__ + readline = (line for line in new_bytes.splitlines(keepends=True)).__next__ tokens2 = [tok[:2] for tok in tokenize(readline)] return tokens1 == tokens2 |