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

This commit is contained in:
Hai Shi 2020-07-06 17:12:49 +08:00 committed by GitHub
parent 9ce8132e1f
commit 883bc63833
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 225 additions and 194 deletions

View file

@ -5,23 +5,27 @@
"""
import unittest
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import warnings_helper
with support.check_warnings(('', DeprecationWarning)):
binhex = support.import_fresh_module('binhex')
with warnings_helper.check_warnings(('', DeprecationWarning)):
binhex = import_helper.import_fresh_module('binhex')
class BinHexTestCase(unittest.TestCase):
def setUp(self):
# binhex supports only file names encodable to Latin1
self.fname1 = support.TESTFN_ASCII + "1"
self.fname2 = support.TESTFN_ASCII + "2"
self.fname3 = support.TESTFN_ASCII + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__"
self.fname1 = os_helper.TESTFN_ASCII + "1"
self.fname2 = os_helper.TESTFN_ASCII + "2"
self.fname3 = os_helper.TESTFN_ASCII + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__"
def tearDown(self):
support.unlink(self.fname1)
support.unlink(self.fname2)
support.unlink(self.fname3)
os_helper.unlink(self.fname1)
os_helper.unlink(self.fname2)
os_helper.unlink(self.fname3)
DATA = b'Jack is my hero'