From 5cce61850da2fc0a6716a5c0b0b0ffa97fa4b1b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20R=C3=B6sner?= Date: Thu, 9 Nov 2023 10:43:20 +0100 Subject: [PATCH] fix: remove unrelated features. --- fsspec/tests/test_utils.py | 21 --------------------- fsspec/utils.py | 1 - 2 files changed, 22 deletions(-) diff --git a/fsspec/tests/test_utils.py b/fsspec/tests/test_utils.py index c7bad93bc..b5732e9f1 100644 --- a/fsspec/tests/test_utils.py +++ b/fsspec/tests/test_utils.py @@ -1,6 +1,5 @@ import io import sys -from pathlib import Path from unittest.mock import Mock import pytest @@ -9,7 +8,6 @@ from fsspec.utils import ( can_be_local, common_prefix, - get_protocol, infer_storage_options, merge_offset_ranges, mirror_from, @@ -335,24 +333,6 @@ def test_log(): assert logger.level == logging.DEBUG -@pytest.mark.parametrize( - "par", - [ - ("afile", "file"), - ("file://afile", "file"), - ("noproto://afile", "noproto"), - ("noproto::stuff", "noproto"), - ("simplecache::stuff", "simplecache"), - ("simplecache://stuff", "simplecache"), - ("s3://afile", "s3"), - (Path("afile"), "file"), - ], -) -def test_get_protocol(par): - url, outcome = par - assert get_protocol(url) == outcome - - @pytest.mark.parametrize( "par", [ @@ -362,7 +342,6 @@ def test_get_protocol(par): ("noproto::stuff", False), ("simplecache::stuff", True), ("simplecache://stuff", True), - (Path("afile"), True), ], ) def test_can_local(par): diff --git a/fsspec/utils.py b/fsspec/utils.py index 543bd89d7..34f1ad821 100644 --- a/fsspec/utils.py +++ b/fsspec/utils.py @@ -436,7 +436,6 @@ def isfilelike(f: Any) -> TypeGuard[IO[bytes]]: def get_protocol(url: str) -> str: - url = stringify_path(url) parts = re.split(r"(\:\:|\://)", url, 1) if len(parts) > 1: return parts[0]