Commit ba31105d authored by R. David Murray's avatar R. David Murray

Merged revisions 76659 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76659 | r.david.murray | 2009-12-03 18:57:59 -0500 (Thu, 03 Dec 2009) | 4 lines

  Issue 7431: use TESTFN in test_linecache instead of trying to create a
  file in the Lib/test directory, which might be read-only for the
  user running the tests.
........
parent 5f885c62
...@@ -83,8 +83,8 @@ class LineCacheTests(unittest.TestCase): ...@@ -83,8 +83,8 @@ class LineCacheTests(unittest.TestCase):
getline = linecache.getline getline = linecache.getline
try: try:
# Create a source file and cache its contents # Create a source file and cache its contents
source_name = os.path.join(TEST_PATH, 'linecache_test.py') source_name = support.TESTFN + '.py'
source = open(source_name, 'w') with open(source_name, 'w') as source:
source.write(SOURCE_1) source.write(SOURCE_1)
source.close() source.close()
getline(source_name, 1) getline(source_name, 1)
...@@ -114,11 +114,7 @@ class LineCacheTests(unittest.TestCase): ...@@ -114,11 +114,7 @@ class LineCacheTests(unittest.TestCase):
for index, line in enumerate(source): for index, line in enumerate(source):
self.assertEquals(line, getline(source_name, index + 1)) self.assertEquals(line, getline(source_name, index + 1))
source_list.append(line) source_list.append(line)
source.close()
finally:
try:
source.close()
finally: finally:
support.unlink(source_name) support.unlink(source_name)
......
...@@ -475,6 +475,10 @@ Documentation ...@@ -475,6 +475,10 @@ Documentation
Tests Tests
----- -----
- Issue #7431: use TESTFN in test_linecache instead of trying to create a
file in the Lib/test directory, which might be read-only for the
user running the tests.
- Issue #7324: add a sanity check to regrtest argument parsing to - Issue #7324: add a sanity check to regrtest argument parsing to
catch the case of an option with no handler. catch the case of an option with no handler.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment