circuitpython/tests/micropython/heapalloc_bytesio2.py
Scott Shawcroft b057fb8a4b
codeformat
2021-04-19 22:22:44 -07:00

22 lines
381 B
Python

# Creating BytesIO from immutable object should not immediately
# copy its content.
try:
import uio
import micropython
micropython.mem_total
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
data = b"1234" * 256
before = micropython.mem_total()
buf = uio.BytesIO(data)
after = micropython.mem_total()
print(after - before < len(data))