class_docstr: Test zipapp module functionality.
class_docstr_tok: ["Test","zipapp","module","functionality","."]
code: def test_create_archive_with_filter(self):
      # Test packing a directory and using filter to specify
      # which files to include.
      def skip_pyc_files(path):
          return path.suffix != ".pyc"
  
      source = self.tmpdir / "source"
      source.mkdir()
      (source / "__main__.py").touch()
      (source / "test.py").touch()
      (source / "test.pyc").touch()
      target = self.tmpdir / "source.pyz"
  
      zipapp.create_archive(source, target, filter=skip_pyc_files)
      with zipfile.ZipFile(target, "r") as z:
          self.assertIn("__main__.py", z.namelist())
          self.assertIn("test.py", z.namelist())
          self.assertNotIn("test.pyc", z.namelist())
  
imports: import io
  import pathlib
  import stat
  import sys
  import tempfile
  import unittest
  import zipapp
  import zipfile
  from test.support import requires_zlib
  from test.support import os_helper
  from unittest.mock import patch
label_desc: Use image node_id 6 for calling the ZipAppTest obj's underlying member method code with example usage: obj.test_create_archive_with_filter() and returns: unknown