diff options
author | Georg Brandl <georg@python.org> | 2013-10-21 06:29:29 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-10-21 06:29:29 (GMT) |
commit | a606542e95f6de9880a2554c7ae0a4d6b02e742b (patch) | |
tree | bcae559d7d456313b806b7b84848d782c37d8694 | |
parent | b0c84cdaac987e075099ac65a218505e9efbdda3 (diff) | |
download | cpython-a606542e95f6de9880a2554c7ae0a4d6b02e742b.zip cpython-a606542e95f6de9880a2554c7ae0a4d6b02e742b.tar.gz cpython-a606542e95f6de9880a2554c7ae0a4d6b02e742b.tar.bz2 |
#19274: use captured_stdout() in the test suite; add NEWS entry.
-rw-r--r-- | Doc/library/zipfile.rst | 6 | ||||
-rw-r--r-- | Lib/test/test_zipfile.py | 13 | ||||
-rw-r--r-- | Misc/NEWS | 8 |
3 files changed, 15 insertions, 12 deletions
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index 3ca20de..f7303ea 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -384,9 +384,6 @@ The :class:`PyZipFile` constructor takes the same parameters as the .. method:: PyZipFile.writepy(pathname, basename='', filterfunc=None) - .. versionadded:: 3.4 - The *filterfunc* parameter. - Search for files :file:`\*.py` and add the corresponding file to the archive. @@ -419,6 +416,9 @@ The :class:`PyZipFile` constructor takes the same parameters as the test/bogus/__init__.pyc # Subpackage directory test/bogus/myfile.pyc # Submodule test.bogus.myfile + .. versionadded:: 3.4 + The *filterfunc* parameter. + .. _zipinfo-objects: diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 4a8c1af..f57da5f 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -597,22 +597,19 @@ class PyZipFileTests(unittest.TestCase): with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp: - stdout = sys.stdout - # first make sure that the test folder gives error messages - sys.stdout = reportSIO = io.StringIO() - zipfp.writepy(packagedir) + # (on the badsyntax_... files) + with captured_stdout() as reportSIO: + zipfp.writepy(packagedir) reportStr = reportSIO.getvalue() self.assertTrue('SyntaxError' in reportStr) # then check that the filter works - sys.stdout = reportSIO = io.StringIO() - zipfp.writepy(packagedir, filterfunc=lambda whatever:False) + with captured_stdout() as reportSIO: + zipfp.writepy(packagedir, filterfunc=lambda whatever: False) reportStr = reportSIO.getvalue() self.assertTrue('SyntaxError' not in reportStr) - sys.stdout = stdout - def test_write_with_optimization(self): import email packagedir = os.path.dirname(email.__file__) @@ -10,9 +10,15 @@ Projected release date: 2013-11-24 Core and Builtins ----------------- -- Issue 19306: Add extra hints to the faulthandler module's stack +- Issue #19306: Add extra hints to the faulthandler module's stack dumps that these are "upside down". +Library +------- + +- Issue #19274: Add a filterfunc parameter to PyZipFile.writepy. + + What's New in Python 3.4.0 Alpha 4? =================================== |