mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
tests: Add tests to improve coverage of py/objtype.c.
This commit is contained in:
15
tests/basics/sys_getsizeof.py
Normal file
15
tests/basics/sys_getsizeof.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# test sys.getsizeof() function
|
||||
|
||||
import sys
|
||||
try:
|
||||
sys.getsizeof
|
||||
except AttributeError:
|
||||
print('SKIP')
|
||||
raise SystemExit
|
||||
|
||||
print(sys.getsizeof([1, 2]) >= 2)
|
||||
print(sys.getsizeof({1: 2}) >= 2)
|
||||
|
||||
class A:
|
||||
pass
|
||||
print(sys.getsizeof(A()) > 0)
|
||||
Reference in New Issue
Block a user