diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-08-04 23:53:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 17:53:12 +0200 |
commit | c7decc27d529c04a4e6b2922e3f3f9419b920f63 (patch) | |
tree | 9bcb971af68ed2e08f4aa4001412d38520194cff /Lib/test/test_tools/test_pathfix.py | |
parent | 604bba1f8fe32479c89b9824b2231cc4480dd110 (diff) | |
download | cpython-git-c7decc27d529c04a4e6b2922e3f3f9419b920f63.tar.gz |
bpo-40275: Use new test.support helper submodules in tests (GH-21727)
Diffstat (limited to 'Lib/test/test_tools/test_pathfix.py')
-rw-r--r-- | Lib/test/test_tools/test_pathfix.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_tools/test_pathfix.py b/Lib/test/test_tools/test_pathfix.py index 03ed29d3f9..ff61935298 100644 --- a/Lib/test/test_tools/test_pathfix.py +++ b/Lib/test/test_tools/test_pathfix.py @@ -3,6 +3,7 @@ import subprocess import sys import unittest from test import support +from test.support import os_helper from test.test_tools import scriptsdir, skip_if_missing @@ -14,7 +15,7 @@ class TestPathfixFunctional(unittest.TestCase): script = os.path.join(scriptsdir, 'pathfix.py') def setUp(self): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) def pathfix(self, shebang, pathfix_flags, exitcode=0, stdout='', stderr='', directory=''): @@ -24,7 +25,7 @@ class TestPathfixFunctional(unittest.TestCase): filename = os.path.join(directory, 'script-A_1.py') pathfix_arg = directory else: - filename = support.TESTFN + filename = os_helper.TESTFN pathfix_arg = filename with open(filename, 'w', encoding='utf8') as f: @@ -56,8 +57,8 @@ class TestPathfixFunctional(unittest.TestCase): return new_shebang def test_recursive(self): - tmpdir = support.TESTFN + '.d' - self.addCleanup(support.rmtree, tmpdir) + tmpdir = os_helper.TESTFN + '.d' + self.addCleanup(os_helper.rmtree, tmpdir) os.mkdir(tmpdir) expected_stderr = f"recursedown('{os.path.basename(tmpdir)}')\n" self.assertEqual( |