summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/builtin_help.py17
-rw-r--r--tests/basics/builtin_help.py.exp14
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/basics/builtin_help.py b/tests/basics/builtin_help.py
new file mode 100644
index 0000000000..902a95175b
--- /dev/null
+++ b/tests/basics/builtin_help.py
@@ -0,0 +1,17 @@
+# test builtin help function
+
+try:
+ help
+except NameError:
+ print("SKIP")
+ import sys
+ sys.exit()
+
+help() # no args
+help(help) # help for a function
+help(int) # help for a class
+help(1) # help for an instance
+import micropython
+help(micropython) # help for a module
+
+print('done') # so last bit of output is predictable
diff --git a/tests/basics/builtin_help.py.exp b/tests/basics/builtin_help.py.exp
new file mode 100644
index 0000000000..ed8a7d74b8
--- /dev/null
+++ b/tests/basics/builtin_help.py.exp
@@ -0,0 +1,14 @@
+########
+object <function> is of type function
+object <class 'int'> is of type type
+ from_bytes -- <classmethod>
+ to_bytes -- <function>
+object 1 is of type int
+ from_bytes -- <classmethod>
+ to_bytes -- <function>
+object <module 'micropython'> is of type module
+ __name__ -- micropython
+ const -- <function>
+ opt_level -- <function>
+########
+done