aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George2015-03-02 18:30:17 +0000
committerDamien George2015-03-02 18:30:17 +0000
commitf2a889564b3a215902622b040a1247af38cb8203 (patch)
tree3cb2e128ed256033f25aed5fee88c728a2074662
parentfe3da09fa095499095219b134d018ca56e61e0f1 (diff)
tests: Add basics test for gc module.
-rw-r--r--tests/basics/gc1.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/basics/gc1.py b/tests/basics/gc1.py
new file mode 100644
index 000000000..140c8b0a6
--- /dev/null
+++ b/tests/basics/gc1.py
@@ -0,0 +1,22 @@
+# basic tests for gc module
+
+try:
+ import gc
+except ImportError:
+ print("SKIP")
+ import sys
+ sys.exit()
+
+print(gc.isenabled())
+gc.disable()
+print(gc.isenabled())
+gc.enable()
+print(gc.isenabled())
+
+gc.collect()
+
+if hasattr(gc, 'mem_free'):
+ # uPy has these extra functions
+ # just test they execute and return an int
+ assert type(gc.mem_free()) is int
+ assert type(gc.mem_alloc()) is int