summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_bytesio2.py
blob: 05c384a516decd26387378d61c0e90481539e9be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Creating BytesIO from immutable object should not immediately
# copy its content.
try:
    import io
    import micropython

    micropython.mem_total
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit


data = b"1234" * 256

before = micropython.mem_total()

buf = io.BytesIO(data)

after = micropython.mem_total()

print(after - before < len(data))