diff options
Diffstat (limited to 'Lib/test/test_linecache.py')
-rw-r--r-- | Lib/test/test_linecache.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py index 375d9c4..cfc6ba8 100644 --- a/Lib/test/test_linecache.py +++ b/Lib/test/test_linecache.py @@ -6,6 +6,7 @@ import os.path import tempfile import tokenize from test import support +from test.support import os_helper FILENAME = linecache.__file__ @@ -44,7 +45,7 @@ class TempFile: with tempfile.NamedTemporaryFile(delete=False) as fp: self.file_name = fp.name fp.write(self.file_byte_string) - self.addCleanup(support.unlink, self.file_name) + self.addCleanup(os_helper.unlink, self.file_name) class GetLineTestsGoodData(TempFile): @@ -124,10 +125,10 @@ class LineCacheTests(unittest.TestCase): self.assertEqual(empty, []) def test_no_ending_newline(self): - self.addCleanup(support.unlink, support.TESTFN) - with open(support.TESTFN, "w") as fp: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with open(os_helper.TESTFN, "w") as fp: fp.write(SOURCE_3) - lines = linecache.getlines(support.TESTFN) + lines = linecache.getlines(os_helper.TESTFN) self.assertEqual(lines, ["\n", "def f():\n", " return 3\n"]) def test_clearcache(self): @@ -150,8 +151,8 @@ class LineCacheTests(unittest.TestCase): def test_checkcache(self): getline = linecache.getline # Create a source file and cache its contents - source_name = support.TESTFN + '.py' - self.addCleanup(support.unlink, source_name) + source_name = os_helper.TESTFN + '.py' + self.addCleanup(os_helper.unlink, source_name) with open(source_name, 'w') as source: source.write(SOURCE_1) getline(source_name, 1) |