diff options
-rw-r--r-- | tests/cpydiff/core_import_all.py | 9 | ||||
-rw-r--r-- | tests/cpydiff/modules3/__init__.py | 1 | ||||
-rw-r--r-- | tests/cpydiff/modules3/foo.py | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/cpydiff/core_import_all.py b/tests/cpydiff/core_import_all.py new file mode 100644 index 000000000..5adf9ae3e --- /dev/null +++ b/tests/cpydiff/core_import_all.py @@ -0,0 +1,9 @@ +""" +categories: Core,import +description: __all__ is unsupported in __init__.py in MicroPython. +cause: Not implemented. +workaround: Manually import the sub-modules directly in __init__.py using ``from . import foo, bar``. +""" +from modules3 import * + +foo.hello() diff --git a/tests/cpydiff/modules3/__init__.py b/tests/cpydiff/modules3/__init__.py new file mode 100644 index 000000000..27a2bf2ad --- /dev/null +++ b/tests/cpydiff/modules3/__init__.py @@ -0,0 +1 @@ +__all__ = ["foo"] diff --git a/tests/cpydiff/modules3/foo.py b/tests/cpydiff/modules3/foo.py new file mode 100644 index 000000000..dd9b9d4dd --- /dev/null +++ b/tests/cpydiff/modules3/foo.py @@ -0,0 +1,2 @@ +def hello(): + print("hello") |