Commit Graph

16 Commits

Author SHA1 Message Date
Damien George
27ca9ab8b2 tests/import: Add .exp file for module_getattr.py to not require Py 3.7. 2018-10-23 11:56:58 +11:00
Paul m. p. P
454cca6016 py/objmodule: Implement PEP 562's __getattr__ for modules.
Configurable via MICROPY_MODULE_GETATTR, disabled by default.  Among other
things __getattr__ for modules can help to build lazy loading / code
unloading at runtime.
2018-10-23 11:22:50 +11:00
Damien George
6d8816fe84 tests/import: Add test for importing invalid .mpy file. 2018-06-18 17:50:34 +10:00
Damien George
409fc8f9c1 tests/import: Update comment now that uPy raises correct exception. 2017-06-28 12:21:29 +10:00
Damien George
3a9445c6b3 tests/import: Add a test for the builtin __import__ function. 2017-06-28 12:21:29 +10:00
Damien George
63e291de70 py/builtinimport: Raise ValueError for bad relative import, per CPython. 2017-01-16 16:21:04 +11:00
Rami Ali
50e14ca619 tests/import: Improve builtinimport.c test coverage. 2017-01-16 15:59:33 +11:00
Damien George
67f3edc10a tests/import: Add a test which uses ... in from-import statement. 2016-12-21 11:25:53 +11:00
Damien George
5e22afce41 tests: Improve test coverage of py/compile.c. 2016-10-11 12:30:32 +11:00
Damien George
3c582bc7cb tests/import: Add test for compiling "import a.b as c". 2016-09-30 14:48:22 +10:00
Paul Sokolovsky
9896314f5b tests: Add test for relative import without package context. 2015-06-27 00:40:22 +03:00
Paul Sokolovsky
ee831cafa9 tests: Add another testcase for relative imports. 2015-02-16 12:11:41 +02:00
Paul Sokolovsky
d0f5e61ab5 py: Implement __file__ attribute for modules. 2014-07-28 21:21:59 +03:00
Damien George
539681fffd tests: Rename test scripts, changing - to _ for consistency.
From now on, all new tests must use underscore.

Addresses issue #727.
2014-07-05 06:14:29 +01:00
Damien George
559d8239ca tests: Move gen_context to import tests, because it relies on import. 2014-04-17 23:21:52 +01:00
Damien George
5cd0b2227f tests: Split out those tests requiring float and import.
Tests in basics (which should probably be renamed to core) should not
rely on float, or import any non-built-in files.  This way these tests
can be run when those features are not available.

All test in basics now pass on the pyboard using stmhal port, except for
string-repr which has some issues with character hex printing.
2014-04-17 16:21:43 +01:00