diff options
author | Inada Naoki <songofacandy@gmail.com> | 2020-04-17 06:56:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-17 06:56:35 (GMT) |
commit | 485e715cb1ff92bc9882cd51ec32589f9cb30503 (patch) | |
tree | 55e3438c85d968dc72737b498960fec39ebf92bc /Lib/test/test_tempfile.py | |
parent | bf1a81258c0ecc8b52b9dcc53321c066b3ed4a67 (diff) | |
download | cpython-485e715cb1ff92bc9882cd51ec32589f9cb30503.zip cpython-485e715cb1ff92bc9882cd51ec32589f9cb30503.tar.gz cpython-485e715cb1ff92bc9882cd51ec32589f9cb30503.tar.bz2 |
bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)
It has not returned the file position after the seek.
Diffstat (limited to 'Lib/test/test_tempfile.py')
-rw-r--r-- | Lib/test/test_tempfile.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index f4cba0f..69d5de2 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1018,7 +1018,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') @@ -1036,7 +1037,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) |