self.assertCompiledIn('email/__init__.py', names)
self.assertCompiledIn('email/mime/text.py', names)
- with captured_stdout() as reportSIO:
+ def test_write_filtered_python_package(self):
+ import test
+ packagedir = os.path.dirname(test.__file__)
+
+ with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
+
+ # first make sure that the test folder gives error messages
+ # (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 on the whole package
+ with captured_stdout() as reportSIO:
+ zipfp.writepy(packagedir, filterfunc=lambda whatever: False)
+ reportStr = reportSIO.getvalue()
+ self.assertTrue('SyntaxError' not in reportStr)
+
+ # then check that the filter works on individual files
++ with captured_stdout() as reportSIO, self.assertWarns(UserWarning):
+ zipfp.writepy(packagedir, filterfunc=lambda fn:
+ 'bad' not in fn)
+ reportStr = reportSIO.getvalue()
+ if reportStr:
+ print(reportStr)
+ self.assertTrue('SyntaxError' not in reportStr)
+
def test_write_with_optimization(self):
import email
packagedir = os.path.dirname(email.__file__)
Library
-------
+ - Issue #20262: Warnings are raised now when duplicate names are added in the
+ ZIP file or too long ZIP file comment is truncated.
+
+- Issue #20165: The unittest module no longer considers tests marked with
+ @expectedFailure successful if they pass.
+
- Issue #18574: Added missing newline in 100-Continue reply from
http.server.BaseHTTPRequestHandler. Patch by Nikolaus Rath.