def fs(fs: FakeFilesystem) -> FakeFilesystem:
    """
    Provide a fake filesystem for tests

    NOTE: Sometimes pyfakefs patching goes wonky, causing the fake file system
    to be cached across tests. This can lead tests failing to access real files
    even if they do not use this fixture. Because we can't fix this issue now,
    it's safer to allow site-packages [read-only] access from tests.
    """
    app_path = os.path.dirname(os.path.abspath(__file__))
    site_packages = site.getsitepackages()  # Allow files within dependencies
    paths_to_add = [app_path]
    for site_package_path in site_packages:
        if not site_package_path.startswith(app_path):
            paths_to_add.append(site_package_path)
    fs.add_real_paths(paths_to_add)
    return fs

    Provide a fake filesystem for tests

    NOTE: Sometimes pyfakefs patching goes wonky, causing the fake file system
    to be cached across tests. This can lead tests failing to access real files
    even if they do not use this fixture. Because we can't fix this issue now,
    it's safer to allow site-packages [read-only] access from tests.
    
api/conftest.py