diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-07-06 09:12:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 09:12:49 (GMT) |
commit | 883bc638335a57a6e6a6344c2fc132c4f9a0ec42 (patch) | |
tree | 1dd74a4aeeb80d8b85ff18de700763199a7bc1bc /Lib/test/test_bufio.py | |
parent | 9ce8132e1f2339cfe116dfd4795574182c2245b4 (diff) | |
download | cpython-883bc638335a57a6e6a6344c2fc132c4f9a0ec42.zip cpython-883bc638335a57a6e6a6344c2fc132c4f9a0ec42.tar.gz cpython-883bc638335a57a6e6a6344c2fc132c4f9a0ec42.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21314)
Diffstat (limited to 'Lib/test/test_bufio.py')
-rw-r--r-- | Lib/test/test_bufio.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_bufio.py b/Lib/test/test_bufio.py index fea6da4..17151b1 100644 --- a/Lib/test/test_bufio.py +++ b/Lib/test/test_bufio.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import os_helper import io # C implementation. import _pyio as pyio # Python implementation. @@ -17,18 +18,18 @@ class BufferSizeTest: # .readline()s deliver what we wrote. # Ensure we can open TESTFN for writing. - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) # Since C doesn't guarantee we can write/read arbitrary bytes in text # files, use binary mode. - f = self.open(support.TESTFN, "wb") + f = self.open(os_helper.TESTFN, "wb") try: # write once with \n and once without f.write(s) f.write(b"\n") f.write(s) f.close() - f = open(support.TESTFN, "rb") + f = open(os_helper.TESTFN, "rb") line = f.readline() self.assertEqual(line, s + b"\n") line = f.readline() @@ -37,7 +38,7 @@ class BufferSizeTest: self.assertFalse(line) # Must be at EOF f.close() finally: - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def drive_one(self, pattern): for length in lengths: |