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

This commit is contained in:
Hai Shi 2020-08-06 19:51:29 +08:00 committed by GitHub
parent 52f98424a5
commit 79bb2c93f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 73 additions and 56 deletions

View file

@ -2,6 +2,7 @@ import pickle
import unittest
from test import support
from test.support import import_helper
from test.support import os_helper
turtle = import_helper.import_module('turtle')
@ -52,10 +53,10 @@ visible = False
class TurtleConfigTest(unittest.TestCase):
def get_cfg_file(self, cfg_str):
self.addCleanup(support.unlink, support.TESTFN)
with open(support.TESTFN, 'w') as f:
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
with open(os_helper.TESTFN, 'w') as f:
f.write(cfg_str)
return support.TESTFN
return os_helper.TESTFN
def test_config_dict(self):