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

This commit is contained in:
Hai Shi 2020-07-09 21:25:10 +08:00 committed by GitHub
parent 61bb24a270
commit 96a6a6d42b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 154 additions and 134 deletions

View file

@ -10,6 +10,7 @@ import codecs
import binascii
import collections
from test import support
from test.support import os_helper
from io import BytesIO
from plistlib import UID
@ -110,7 +111,7 @@ class TestPlistlib(unittest.TestCase):
def tearDown(self):
try:
os.unlink(support.TESTFN)
os.unlink(os_helper.TESTFN)
except:
pass
@ -148,10 +149,10 @@ class TestPlistlib(unittest.TestCase):
def test_io(self):
pl = self._create()
with open(support.TESTFN, 'wb') as fp:
with open(os_helper.TESTFN, 'wb') as fp:
plistlib.dump(pl, fp)
with open(support.TESTFN, 'rb') as fp:
with open(os_helper.TESTFN, 'rb') as fp:
pl2 = plistlib.load(fp)
self.assertEqual(dict(pl), dict(pl2))