circuitpython/tests/cpydiff
Yoctopuce dev 66c0148022 py/runtime: Add support for using __all__ in star import.
When the symbol `__all__` is defined in a module, `mp_import_all()` should
import all listed symbols into the global environment, rather than relying
on the underscore-is-private default.  This is the standard in CPython.

Each item is loaded in the same way as if it would be an explicit import
statement, and will invoke the module's `__getattr__` function if needed.
This provides a straightforward solution for fixing star import of modules
using a dynamic loader, such as `extmod/asyncio` (see issue #7266).

This improvement has been enabled at BASIC_FEATURES level, to avoid
impacting devices with limited ressources, for which star import is of
little use anyway.

Additionally, detailled reporting of errors during `__all__` import has
been implemented to match CPython, but this is only enabled when
ERROR_REPORTING is set to MICROPY_ERROR_REPORTING_DETAILED.

Signed-off-by: Yoctopuce dev <dev@yoctopuce.com>
2025-06-23 16:05:12 +10:00
..
modules tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
modules2/subpkg tests/cpydiff/core_import_split_ns_pkgs: Test for split namespace packages. 2017-05-03 17:16:19 +03:00
core_class_delnotimpl.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
core_class_mro.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
core_class_name_mangling.py tests/cpydiff: Add new CPy diff test for class name mangling. 2024-02-21 11:42:35 +11:00
core_class_super_init.py tests/cpydiff: Add diff for overriding __init__. 2024-07-25 12:01:43 +10:00
core_class_supermultiple.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
core_class_superproperty.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
core_fstring_concat.py tests/cpydiff: Ensure all have two levels of category. 2025-05-16 11:52:03 +10:00
core_fstring_parser.py tests/cpydiff: Ensure all have two levels of category. 2025-05-16 11:52:03 +10:00
core_fstring_repr.py tests/cpydiff: Ensure all have two levels of category. 2025-05-16 11:52:03 +10:00
core_function_argcount.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
core_function_moduleattr.py tests/cpydiff: Add test and workaround for function.__module__ attr. 2021-05-16 11:06:46 +10:00
core_function_userattr.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
core_generator_noexit.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
core_import_path.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
core_import_split_ns_pkgs.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
core_locals.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
core_locals_eval.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
module_array_comparison.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
module_array_constructor.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_array_containment.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_array_deletion.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_array_subscrstep.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_json_nonserializable.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_os_environ.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_os_getenv.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_random_getrandbits.py extmod/modurandom: Add error message when getrandbits has bad value. 2021-05-30 16:41:30 +10:00
modules_random_randint.py all: Update Python formatting to latest Black version 22.1.0. 2022-02-02 16:49:55 +11:00
modules_struct_fewargs.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_struct_manyargs.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_struct_whitespace_in_format.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
modules_sys_stdassign.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
syntax_arg_unpacking.py tests/cpydiff: Ensure all have two levels of category. 2025-05-16 11:52:03 +10:00
syntax_assign_expr.py tests/cpydiff: Update CPy diff for assign expr in nested comprehensions. 2025-04-07 15:43:03 +10:00
syntax_literal_underscore.py tests/cpydiff: Add test of underscore-in-literals. 2025-05-16 11:52:03 +10:00
syntax_spaces.py tests/cpydiff: Ensure all have two levels of category. 2025-05-16 11:52:03 +10:00
syntax_unicode_nameesc.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_bytearray_sliceassign.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_bytes_format.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_bytes_keywords.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_bytes_subscrstep.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_complex_parser.py tests/cpydiff: Document complex() parsing difference. 2025-06-16 23:34:34 +10:00
types_dict_keys_set.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_exception_attrs.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_exception_chaining.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_exception_instancevar.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_exception_loops.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_exception_subclassinit.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
types_float_implicit_conversion.py tests/cpydiff: Fix formatting of code snippet to use double quotes. 2022-07-29 12:23:05 +10:00
types_float_rounding.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_int_bit_length.py extmod/modurandom: Add error message when getrandbits has bad value. 2021-05-30 16:41:30 +10:00
types_int_subclassconv.py tests: Format all Python code with black, except tests in basics subdir. 2020-03-30 13:21:58 +11:00
types_int_to_bytes.py py/objint: Fix int.to_bytes() buffer size checks. 2024-06-24 14:07:00 +10:00
types_list_delete_subscrstep.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_list_store_noniter.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_list_store_subscrstep.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_memoryview_invalid.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_str_formatsep.py tests/cpydiff: Document format separator difference. 2025-05-13 12:19:46 +10:00
types_str_formatsubscr.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_str_keywords.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_str_ljust_rjust.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_str_rsplitnone.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_str_subscrstep.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00
types_tuple_subscrstep.py all: Upgrade to ruff v0.9.6. 2025-02-25 13:02:49 +01:00