diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-08-06 11:51:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-06 11:51:29 (GMT) |
commit | 79bb2c93f2d81702fdf1f93720369e18a76b7d1a (patch) | |
tree | 6ab9d0c6ef07954cc871dd6eb06f3a80329d33e6 /Lib/test/test_socketserver.py | |
parent | 52f98424a55e14f05dfa7483cc0faf634a61c9ff (diff) | |
download | cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.zip cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.tar.gz cpython-79bb2c93f2d81702fdf1f93720369e18a76b7d1a.tar.bz2 |
bpo-40275: Use new test.support helper submodules in tests (GH-21743)
Diffstat (limited to 'Lib/test/test_socketserver.py')
-rw-r--r-- | Lib/test/test_socketserver.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index 5db8cec..7cdd115 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -15,6 +15,7 @@ import socketserver import test.support from test.support import reap_children, verbose +from test.support import os_helper from test.support import socket_helper from test.support import threading_helper @@ -299,7 +300,7 @@ class ErrorHandlerTest(unittest.TestCase): KeyboardInterrupt are not passed.""" def tearDown(self): - test.support.unlink(test.support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_sync_handled(self): BaseErrorTestServer(ValueError) @@ -329,7 +330,7 @@ class ErrorHandlerTest(unittest.TestCase): self.check_result(handled=False) def check_result(self, handled): - with open(test.support.TESTFN) as log: + with open(os_helper.TESTFN) as log: expected = 'Handler called\n' + 'Error handled\n' * handled self.assertEqual(log.read(), expected) @@ -347,7 +348,7 @@ class BaseErrorTestServer(socketserver.TCPServer): self.wait_done() def handle_error(self, request, client_address): - with open(test.support.TESTFN, 'a') as log: + with open(os_helper.TESTFN, 'a') as log: log.write('Error handled\n') def wait_done(self): @@ -356,7 +357,7 @@ class BaseErrorTestServer(socketserver.TCPServer): class BadHandler(socketserver.BaseRequestHandler): def handle(self): - with open(test.support.TESTFN, 'a') as log: + with open(os_helper.TESTFN, 'a') as log: log.write('Handler called\n') raise self.server.exception('Test error') |