summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio/test_base_events.py
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-06-25 20:15:40 +0800
committerGitHub <noreply@github.com>2020-06-25 14:15:40 +0200
commit06a40d735939fd7d5cb77a68a6e18299b6484fa5 (patch)
tree1d830596f995942fb2b6088002cab6ebcb0aee0d /Lib/test/test_asyncio/test_base_events.py
parent91698d8caa4b5bb6e8dbb64b156e8afe9e32cac1 (diff)
downloadcpython-git-06a40d735939fd7d5cb77a68a6e18299b6484fa5.tar.gz
bpo-40275: Use new test.support helper submodules in tests (GH-20824)
Diffstat (limited to 'Lib/test/test_asyncio/test_base_events.py')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 533d5cc7f5..f74dabc2db 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -16,6 +16,7 @@ from asyncio import constants
from test.test_asyncio import utils as test_utils
from test import support
from test.support.script_helper import assert_python_ok
+from test.support import os_helper
from test.support import socket_helper
@@ -1983,14 +1984,14 @@ class BaseLoopSockSendfileTests(test_utils.TestCase):
def setUpClass(cls):
cls.__old_bufsize = constants.SENDFILE_FALLBACK_READBUFFER_SIZE
constants.SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 16
- with open(support.TESTFN, 'wb') as fp:
+ with open(os_helper.TESTFN, 'wb') as fp:
fp.write(cls.DATA)
super().setUpClass()
@classmethod
def tearDownClass(cls):
constants.SENDFILE_FALLBACK_READBUFFER_SIZE = cls.__old_bufsize
- support.unlink(support.TESTFN)
+ os_helper.unlink(os_helper.TESTFN)
super().tearDownClass()
def setUp(self):
@@ -1998,7 +1999,7 @@ class BaseLoopSockSendfileTests(test_utils.TestCase):
# BaseSelectorEventLoop() has no native implementation
self.loop = BaseSelectorEventLoop()
self.set_event_loop(self.loop)
- self.file = open(support.TESTFN, 'rb')
+ self.file = open(os_helper.TESTFN, 'rb')
self.addCleanup(self.file.close)
super().setUp()
@@ -2095,7 +2096,7 @@ class BaseLoopSockSendfileTests(test_utils.TestCase):
def test_nonbinary_file(self):
sock = self.make_socket()
- with open(support.TESTFN, 'r') as f:
+ with open(os_helper.TESTFN, 'r') as f:
with self.assertRaisesRegex(ValueError, "binary mode"):
self.run_loop(self.loop.sock_sendfile(sock, f))