Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbourbeau committed Nov 21, 2024
1 parent d97e87a commit 0950540
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
shell: bash -l {0}
run: |
pip install -e .[test_full]
pytest -v
pytest -v fsspec/tests/test_spec.py
win:
name: pytest-win
Expand Down
8 changes: 6 additions & 2 deletions fsspec/tests/test_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,15 @@ def test_cache():


def test_cache_not_pickled(server):
fs = fsspec.filesystem("http")
fs = fsspec.filesystem(
"http",
cache_type="readahead",
headers={"give_length": "true", "head_ok": "true"},
)
# fs = fsspec.filesystem("readahead", target_protocol="http")
filepath = server.realfile
length = 3
f = fs.open(filepath, mode="rb", cache_type="readahead")
f = fs.open(filepath, mode="rb")
assert not f.cache.cache # No cache initially
assert f.read(length=length) == data[:length]
assert f.cache.cache == data # Cache is populated
Expand Down

0 comments on commit 0950540

Please sign in to comment.