diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-07-06 09:15:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 09:15:08 (GMT) |
commit | a089d21df1ea502b995d8e8a3bcc937cce030802 (patch) | |
tree | 0ca48d704e4b63bd7090483a24879a09e1f911eb /Lib/test/test_file.py | |
parent | 883bc638335a57a6e6a6344c2fc132c4f9a0ec42 (diff) | |
download | cpython-a089d21df1ea502b995d8e8a3bcc937cce030802.zip cpython-a089d21df1ea502b995d8e8a3bcc937cce030802.tar.gz cpython-a089d21df1ea502b995d8e8a3bcc937cce030802.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21315)
Diffstat (limited to 'Lib/test/test_file.py')
-rw-r--r-- | Lib/test/test_file.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index cd642e7..1497675 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -7,8 +7,9 @@ from weakref import proxy import io import _pyio as pyio -from test.support import TESTFN -from test import support +from test.support.os_helper import TESTFN +from test.support import os_helper +from test.support import warnings_helper from collections import UserList class AutoFileTests: @@ -20,7 +21,7 @@ class AutoFileTests: def tearDown(self): if self.f: self.f.close() - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def testWeakRefs(self): # verify weak references @@ -139,7 +140,7 @@ class PyAutoFileTests(AutoFileTests, unittest.TestCase): class OtherFileTests: def tearDown(self): - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def testModeStrings(self): # check invalid mode strings @@ -187,7 +188,7 @@ class OtherFileTests: # make sure that explicitly setting the buffer size doesn't cause # misbehaviour especially with repeated close() calls for s in (-1, 0, 512): - with support.check_no_warnings(self, + with warnings_helper.check_no_warnings(self, message='line buffering', category=RuntimeWarning): self._checkBufferSize(s) |