diff --git a/tests/cpydiff/core_import_all.py b/tests/cpydiff/core_import_all.py new file mode 100644 index 0000000000..5adf9ae3eb --- /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 0000000000..27a2bf2ad9 --- /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 0000000000..dd9b9d4ddd --- /dev/null +++ b/tests/cpydiff/modules3/foo.py @@ -0,0 +1,2 @@ +def hello(): + print("hello")