code: def test_custom_fs_validation(tmp_path):
      """Tests that invalid storage_path inputs give reasonable errors when a
      custom filesystem is used."""
      exp_name = "test"
      StorageContext(
          storage_path=str(tmp_path),
          experiment_dir_name=exp_name,
          storage_filesystem=pyarrow.fs.LocalFileSystem(),
      )
  
      mock_fs, _ = pyarrow.fs.FileSystem.from_uri("mock://a")
      with pytest.raises(pyarrow.lib.ArrowInvalid) as excinfo:
          StorageContext(
              storage_path="mock:///a",
              experiment_dir_name=exp_name,
              storage_filesystem=mock_fs,
          )
      print("Custom fs with URI storage path error: ", excinfo.value)
  
      StorageContext(
          storage_path="a",
          experiment_dir_name=exp_name,
          storage_filesystem=mock_fs,
      )
  
file_path: ray/python/ray/train/tests/test_storage.py
imports: import os
  from pathlib import Path
  import pyarrow.fs
  import pytest
  import ray.cloudpickle
  from ray.train import Checkpoint, SyncConfig
  from ray.train._internal.storage import _VALIDATE_STORAGE_MARKER_FILENAME, StorageContext, _list_at_fs_path
  from ray.train.tests.test_new_persistence import _resolve_storage_type
label_desc: Use image node_id 3 for calling a global function with example usage: test_custom_fs_validation(tmp_path) without return types