bpo-40275: Use new test.support helper submodules in tests (GH-21315)

This commit is contained in:
Hai Shi 2020-07-06 17:15:08 +08:00 committed by GitHub
parent 883bc63833
commit a089d21df1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 69 additions and 49 deletions

View file

@ -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)