Skip to content

Commit a337668

Browse files
committed
tests/extmod/deflate_decompress.py: Skip test when not enough memory.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 3695211 commit a337668

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/extmod/deflate_decompress.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@
66
print("SKIP")
77
raise SystemExit
88

9+
try:
10+
# Check there's enough memory to deflate gzip streams.
11+
# zlib.compress(b'', wbits=25)
12+
empty_gzip = (
13+
b"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x03\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00"
14+
)
15+
deflate.DeflateIO(io.BytesIO(empty_gzip)).read()
16+
except MemoryError:
17+
print("SKIP")
18+
raise SystemExit
19+
920
# zlib.compress(b'micropython hello world hello world micropython', wbits=-9)
1021
data_raw = b'\xcb\xcdL.\xca/\xa8,\xc9\xc8\xcfS\xc8H\xcd\xc9\xc9W(\xcf/\xcaIAa\xe7"\xd4\x00\x00'
1122
# zlib.compress(b'micropython hello world hello world micropython', wbits=9)

0 commit comments

Comments
 (0)