8000 tests/cpydiff: Add cpydiff test for __all__ used in imported package. · webduino-cn/micropython@309c19d · GitHub
[go: up one dir, main page]

Skip to content

Commit 309c19d

Browse files
jimmodpgeorge
authored andcommitted
tests/cpydiff: Add cpydiff test for __all__ used in imported package.
1 parent 73c5815 commit 309c19d

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

tests/cpydiff/core_import_all.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""
2+
categories: Core,import
3+
description: __all__ is unsupported in __init__.py in MicroPython.
4+
cause: Not implemented 8B03 .
5+
workaround: Manually import the sub-modules directly in __init__.py using ``from . import foo, bar``.
6+
"""
7+
from modules3 import *
8+
9+
foo.hello()

tests/cpydiff/modules3/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__all__ = ["foo"]

tests/cpydiff/modules3/foo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def hello():
2+
print("hello")

0 commit comments

Comments
 (0)
0