code: def test_open_pathlike():
      class MyPath:
          def __fspath__(self):
              return str(Path.cwd() / "tests" / "data" / "RGB.byte.tif")
  
      with rasterio.open(MyPath()) as src:
          assert src.count == 3
  
file_path: rasterio/tests/test_open.py
imports: import pytest
  import rasterio
  from pathlib import Path
label_desc: Use image node_id 6 for calling a global function with example usage: test_open_pathlike() and returns: str