Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a606542e
Commit
a606542e
authored
Oct 21, 2013
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19274: use captured_stdout() in the test suite; add NEWS entry.
parent
b0c84cda
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
Doc/library/zipfile.rst
Doc/library/zipfile.rst
+3
-3
Lib/test/test_zipfile.py
Lib/test/test_zipfile.py
+5
-8
Misc/NEWS
Misc/NEWS
+7
-1
No files found.
Doc/library/zipfile.rst
View file @
a606542e
...
...
@@ -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:
...
...
Lib/test/test_zipfile.py
View file @
a606542e
...
...
@@ -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__
)
...
...
Misc/NEWS
View file @
a606542e
...
...
@@ -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?
===================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment