code: def test_copy_files_with_exception(tmpdir):
      """Test that the `test_copy_files` utility properly raises exceptions from within the ThreadPoolExecutor."""
      fs_mock = Mock()
      fs_mock().put = Mock(side_effect=ValueError("error from thread"))
  
      src = pathlib.Path(tmpdir, "src")
      src.mkdir()
      assert src.is_dir()
      pathlib.Path(src, "file.txt").touch()
      dst = pathlib.Path(tmpdir, "dest")
  
      with mock.patch(
          "lightning.app.storage.copier._filesystem", fs_mock
      ), pytest.raises(ValueError, match="error from thread"):
          _copy_files(src, dst)
  
file_path: pytorch-lightning/tests/tests_app/storage/test_copier.py
imports: import os
  import pathlib
  from unittest import mock
  from unittest.mock import Mock
  import lightning.app
  import pytest
  from lightning.app.storage.copier import _Copier, _copy_files
  from lightning.app.storage.path import Path
  from lightning.app.storage.requests import _ExistsRequest, _GetRequest
  from lightning.app.testing.helpers import _MockQueue
label_desc: Use image node_id 5 for calling a global function with example usage: test_copy_files_with_exception(tmpdir) without return types