summaryrefslogtreecommitdiffstatshomepage
path: root/tests/extmod/marshal_micropython.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/extmod/marshal_micropython.py')
-rw-r--r--tests/extmod/marshal_micropython.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/extmod/marshal_micropython.py b/tests/extmod/marshal_micropython.py
new file mode 100644
index 0000000000..213b3bf318
--- /dev/null
+++ b/tests/extmod/marshal_micropython.py
@@ -0,0 +1,21 @@
+# Test the marshal module, MicroPython-specific functionality.
+
+try:
+ import marshal
+except ImportError:
+ print("SKIP")
+ raise SystemExit
+
+import unittest
+
+
+class Test(unittest.TestCase):
+ def test_function_with_children(self):
+ # Can't marshal a function with children (in this case the module has a child function f).
+ code = compile("def f(): pass", "", "exec")
+ with self.assertRaises(ValueError):
+ marshal.dumps(code)
+
+
+if __name__ == "__main__":
+ unittest.main()