summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-04-17 07:13:34 (GMT)
committerGitHub <noreply@github.com>2020-04-17 07:13:34 (GMT)
commit11ae7d075293fe855c8af26b577656d1026cd9bb (patch)
tree8a5883f66f465411a8789b9ea53500ef31e39cda /Lib/test
parent6fd47fabe04a1d52c61e87d594d10dd65e6432ee (diff)
downloadcpython-11ae7d075293fe855c8af26b577656d1026cd9bb.zip
cpython-11ae7d075293fe855c8af26b577656d1026cd9bb.tar.gz
cpython-11ae7d075293fe855c8af26b577656d1026cd9bb.tar.bz2
bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)
It has not returned the file position after the seek. (cherry picked from commit 485e715cb1ff92bc9882cd51ec32589f9cb30503) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_tempfile.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index c046420..2d47e70 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -1034,7 +1034,8 @@ class TestSpooledTemporaryFile(BaseTestCase):
# Verify writelines with a SpooledTemporaryFile
f = self.do_create()
f.writelines((b'x', b'y', b'z'))
- f.seek(0)
+ pos = f.seek(0)
+ self.assertEqual(pos, 0)
buf = f.read()
self.assertEqual(buf, b'xyz')
@@ -1052,7 +1053,8 @@ class TestSpooledTemporaryFile(BaseTestCase):
# when that occurs
f = self.do_create(max_size=30)
self.assertFalse(f._rolled)
- f.seek(100, 0)
+ pos = f.seek(100, 0)
+ self.assertEqual(pos, 100)
self.assertFalse(f._rolled)
f.write(b'x')
self.assertTrue(f._rolled)