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

This commit is contained in:
Hai Shi 2020-08-04 00:49:18 +08:00 committed by GitHub
parent bb0424b122
commit 4660597b51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 185 additions and 154 deletions

View file

@ -1,4 +1,5 @@
from test import support
from test.support import os_helper
from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP,
STRING, ENDMARKER, ENCODING, tok_name, detect_encoding,
open as tokenize_open, Untokenizer, generate_tokens,
@ -1265,8 +1266,8 @@ class TestDetectEncoding(TestCase):
self.assertEqual(consumed_lines, [b'print("#coding=fake")'])
def test_open(self):
filename = support.TESTFN + '.py'
self.addCleanup(support.unlink, filename)
filename = os_helper.TESTFN + '.py'
self.addCleanup(os_helper.unlink, filename)
# test coding cookie
for encoding in ('iso-8859-15', 'utf-8'):