mirror of
https://github.com/python/cpython.git
synced 2025-12-09 10:37:17 +00:00
bpo-40275: Use new test.support helper submodules in tests (GH-21315)
This commit is contained in:
parent
883bc63833
commit
a089d21df1
20 changed files with 69 additions and 49 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue