Skip to content

Commit 503a40b

Browse files
committed
known_parts always strict
1 parent f2fa12f commit 503a40b

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

fsspec/tests/test_caches.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -225,24 +225,19 @@ def test_cache_basic(Cache_imp, blocksize, size_requests):
225225
assert result == expected
226226

227227

228-
@pytest.mark.parametrize("strict", [True, False])
229228
@pytest.mark.parametrize("sort", [True, False])
230-
def test_known(sort, strict):
229+
def test_known(sort):
231230
parts = {(10, 20): b"1" * 10, (20, 30): b"2" * 10, (0, 10): b"0" * 10}
232231
if sort:
233232
parts = dict(sorted(parts.items()))
234-
c = caches["parts"](None, None, 100, parts, strict=strict)
233+
c = caches["parts"](None, None, 100, parts)
235234
assert (0, 30) in c.data # got consolidated
236235
assert c._fetch(5, 15) == b"0" * 5 + b"1" * 5
237236
assert c._fetch(15, 25) == b"1" * 5 + b"2" * 5
238-
if strict:
239-
# Over-read will raise error
240-
with pytest.raises(ValueError):
241-
# tries to call None fetcher
242-
c._fetch(25, 35)
243-
else:
244-
# Over-read will be zero-padded
245-
assert c._fetch(25, 35) == b"2" * 5 + b"\x00" * 5
237+
# Over-read will raise error
238+
with pytest.raises(ValueError):
239+
# tries to call None fetcher
240+
c._fetch(25, 35)
246241

247242

248243
def test_background(server, monkeypatch):

0 commit comments

Comments
 (0)