diff options
Diffstat (limited to 'Lib/test/test_tools/test_fixcid.py')
-rw-r--r-- | Lib/test/test_tools/test_fixcid.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/test/test_tools/test_fixcid.py b/Lib/test/test_tools/test_fixcid.py index bce029b1aac..3df13680437 100644 --- a/Lib/test/test_tools/test_fixcid.py +++ b/Lib/test/test_tools/test_fixcid.py @@ -5,6 +5,7 @@ import os, os.path import runpy import sys from test import support +from test.support import os_helper from test.test_tools import skip_if_missing, scriptsdir import unittest @@ -57,15 +58,15 @@ class Test(unittest.TestCase): ) def test_directory(self): - os.mkdir(support.TESTFN) - self.addCleanup(support.rmtree, support.TESTFN) - c_filename = os.path.join(support.TESTFN, "file.c") + os.mkdir(os_helper.TESTFN) + self.addCleanup(os_helper.rmtree, os_helper.TESTFN) + c_filename = os.path.join(os_helper.TESTFN, "file.c") with open(c_filename, "w") as file: file.write("int xx;\n") - with open(os.path.join(support.TESTFN, "file.py"), "w") as file: + with open(os.path.join(os_helper.TESTFN, "file.py"), "w") as file: file.write("xx = 'unaltered'\n") script = os.path.join(scriptsdir, "fixcid.py") - output = self.run_script(args=(support.TESTFN,)) + output = self.run_script(args=(os_helper.TESTFN,)) self.assertMultiLineEqual(output, "{}:\n" "1\n" @@ -74,10 +75,10 @@ class Test(unittest.TestCase): ) def run_script(self, input="", *, args=("-",), substfile="xx yy\n"): - substfilename = support.TESTFN + ".subst" + substfilename = os_helper.TESTFN + ".subst" with open(substfilename, "w") as file: file.write(substfile) - self.addCleanup(support.unlink, substfilename) + self.addCleanup(os_helper.unlink, substfilename) argv = ["fixcid.py", "-s", substfilename] + list(args) script = os.path.join(scriptsdir, "fixcid.py") |