summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_bytesio2.py
blob: cd76f580775c7b561f8e804609322fabd4ad77ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 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))