Author: Brian Kearns <[email protected]>
Branch: stdlib-2.7.9
Changeset: r75038:11ea34526fbb
Date: 2014-12-19 12:45 -0500
http://bitbucket.org/pypy/pypy/changeset/11ea34526fbb/
Log: fix test_doctest test_lineendings not closing files
diff --git a/lib-python/2.7/test/test_doctest.py
b/lib-python/2.7/test/test_doctest.py
--- a/lib-python/2.7/test/test_doctest.py
+++ b/lib-python/2.7/test/test_doctest.py
@@ -2580,7 +2580,8 @@
>>> import tempfile, os
>>> fn = tempfile.mktemp()
- >>> open(fn, 'w').write('Test:\r\n\r\n >>> x = 1 + 1\r\n\r\nDone.\r\n')
+ >>> with open(fn, 'w') as fobj:
+ ... fobj.write('Test:\r\n\r\n >>> x = 1 + 1\r\n\r\nDone.\r\n')
>>> doctest.testfile(fn, False)
TestResults(failed=0, attempted=1)
>>> os.remove(fn)
@@ -2588,7 +2589,8 @@
And now *nix line endings:
>>> fn = tempfile.mktemp()
- >>> open(fn, 'w').write('Test:\n\n >>> x = 1 + 1\n\nDone.\n')
+ >>> with open(fn, 'w') as fobj:
+ ... fobj.write('Test:\n\n >>> x = 1 + 1\n\nDone.\n')
>>> doctest.testfile(fn, False)
TestResults(failed=0, attempted=1)
>>> os.remove(fn)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit