Commit Graph

9 Commits

Author SHA1 Message Date
Damien George 865b61dac2 tests/micropython: Add tests that const tuples don't use the heap.
Signed-off-by: Damien George <damien@micropython.org>
2022-04-15 00:17:02 +10:00
David Lechner 3dc324d3f1 tests: Format all Python code with black, except tests in basics subdir.
This adds the Python files in the tests/ directory to be formatted with
./tools/codeformat.py.  The basics/ subdirectory is excluded for now so we
aren't changing too much at once.

In a few places `# fmt: off`/`# fmt: on` was used where the code had
special formatting for readability or where the test was actually testing
the specific formatting.
2020-03-30 13:21:58 +11:00
Paul Sokolovsky 016f830536 tests/heapalloc, heapalloc_super: Skip in strict stackless mode.
These tests involves testing allocation-free function calling, and in strict
stackless mode, it's not possible to make a function call with heap locked
(because function activation record aka frame is allocated on the heap).
2017-12-11 12:04:59 +02:00
Damien George 1f43d49f9e tests/micropython: Move alloc-less traceback test to separate test file.
The native emitter doesn't provide proper traceback info so this test
should not be run in that case.
2016-11-21 17:39:23 +11:00
Damien George d70f87aaa2 tests/micropython: Add test for creating traceback without allocation. 2016-11-21 17:10:17 +11:00
Damien George 34d0b3f85c tests/micropython: Add tests for heap_lock, and emergency exceptions. 2016-10-14 00:32:34 +11:00
Damien George 6e56bb623c py: Fallback to stack alloca for Python-stack if heap alloc fails.
If heap allocation for the Python-stack of a function fails then we may
as well allocate the Python-stack on the C stack.  This will allow to
run more code without using the heap.
2015-06-08 22:07:27 +01:00
Damien George 109c1de015 py: Make gc.enable/disable just control auto-GC; alloc is still allowed.
gc.enable/disable are now the same as CPython: they just control whether
automatic garbage collection is enabled or not.  If disabled, you can
still allocate heap memory, and initiate a manual collection.
2014-10-31 21:30:46 +00:00
Damien George 4d659f566f tests: Add feature test for when heap allocation is disabled. 2014-05-31 18:33:16 +01:00