Commit graph

2737 commits

Author SHA1 Message Date
9113e171ba Throw TypeError when json-serializing invalid types
This behavior is in line with standard Python

Closes: #9768
2024-11-04 09:16:44 -06:00
71eea30639 keep PYTHONPATH when requested
This turns out to be needed by the testsuite of jepler_udecimal, which
needs to add the `jepler_udecimal` directory both to PYTHONPATH and
MICROPYPATH.
2024-09-23 21:02:08 -05:00
Dan Halbert
c0a3e28079 tests/run-natmodtests.py: remove use of zlib examples 2024-09-13 09:26:54 -04:00
Dan Halbert
50f01014b4 revert to using os.mount, etc. instead of vfs.mount 2024-09-10 18:23:39 -04:00
Dan Halbert
483268314b restore tests/unix; deleted by mistake 2024-09-10 17:57:27 -04:00
Dan Halbert
1f68fffa13 merge from main 2024-09-10 16:36:32 -04:00
Dan Halbert
0c26a114a4 fix tests; asyncio: avoid coroutine never awaited 2024-09-10 16:05:21 -04:00
Dan Halbert
02e11a9413 fix compilation issues; remove more uctypes mentions 2024-09-10 16:04:47 -04:00
Dan Halbert
7812695281 non-conflict merge changes 2024-09-05 14:54:18 -04:00
timdechant
da581102f6 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:48:53 -04:00
timdechant
319fb89d31 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:48:33 -04:00
timdechant
67c8b07343 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:47:19 -04:00
timdechant
8b873b65ac shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:47:05 -04:00
timdechant
c6c4c79330 shared/runtime/sys_stdio_mphal: Fix docstring for stdio.
Signed-off-by: timdechant <timdechant.git@gmail.com>
2024-09-03 22:41:34 -04:00
Dan Halbert
ac7e15f88a (only) reserve merge conflicts 2024-08-28 16:31:37 -04:00
Dan Halbert
b94815ccc8 tests/extmod/select_poll_fd.py: disable fd limit test 2024-08-20 21:22:10 -04:00
Dan Halbert
342f7a9daa tests/micropython/import_mpy_native_gc.py: update native .mpy 2024-08-19 13:04:06 -04:00
Dan Halbert
29216d7485 asyncio update; set fd max in test 2024-08-17 12:22:03 -04:00
Dan Halbert
4d72d6ad25 update asyncio library and fix tests 2024-08-16 23:46:29 -04:00
Dan Halbert
6f721b3dbe fix more tests; get some tests from v1.23 or later 2024-08-06 22:10:39 -04:00
Dan Halbert
4b0aee4903 fix some tests 2024-08-06 16:23:12 -04:00
Dan Halbert
be6fa2af21 merge from main 2024-07-29 17:41:46 -04:00
Dan Halbert
69b667406b MPy v1.22 merge: initial merge; not compiled yet 2024-07-25 15:16:24 -04:00
Scott Shawcroft
612bf209b5
Merge pull request #9421 from timchinowsky/rawsample-doublebuffer
Add double buffering to RawSample
2024-07-22 13:24:30 -07:00
Tim
e8a7700af4 add looping to rp2040 analogbufio.BufferedIn 2024-07-18 12:03:15 -07:00
Tim
a1fe288ab8 make loop=True required for constant play, add test code 2024-07-16 13:47:09 -07:00
Tim
6c1227efdd add tests of pwm extremes 2024-07-03 10:21:34 -07:00
Tim
8a1b3e7cfc disallow duty cycle rounding to 0 2024-07-03 09:37:55 -07:00
Dan Halbert
d35c2e34b0 tests/circuitpython-manual/pwmio: shrink png images 2024-06-21 14:16:59 -04:00
Tim
59e604c783 move pwm test to tests/circuitpython-manual 2024-06-20 09:58:37 -07:00
2f3d371762 update expected result due to addition of audiomp3 module 2024-05-30 14:49:09 -05:00
Damien George
30a9ccf4ca tests/basics: Move str/bytes tests that give SyntaxWarning to sep file.
In CPython 3.12 these invalid str/bytes/fstring escapes will issue a
SyntaxWarning, and so differ to MicroPython.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-28 10:58:37 +10:00
Damien George
dd4767a7d1 tests/basics: Add .exp file for slice_op test.
CPython 3.12 implemented hashing for slices, so now differs to MicroPython.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-28 10:50:57 +10:00
Damien George
ad6750b22e tests/float: Use "not" instead of ~ to invert bool value.
Otherwise CPython gives a deprecation warning.

This test is not actually testing inversion of bools, rather that bit of
the test is used to compute the pass/fail result.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-28 10:49:22 +10:00
Damien George
a34b5d1b79 tests/net_inet/tls_text_errors.py: Tweak test for newer CPython version.
Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 13:56:55 +10:00
Damien George
e1111d873a tests/net_hosted/ssl_verify_callback.py: Make exp match actual output.
The `cert` argument passed to the verify callback is actually a memoryview.
And the `depth` argument seems to start at 1 for the tested URL.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 13:56:55 +10:00
Damien George
1a2fdcac0d tests/basics: Split out generator.throw tests that pass multiple args.
The three-argument form of `.throw()` is deprecated since CPython 3.12.  So
split out into separate tests (with .exp files) the parts of the generator
tests that test more than one argument.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 13:56:55 +10:00
Damien George
2e852522b1 tests/extmod: Add .exp test files for asyncio.get_event_loop tests.
And use `asyncio.new_event_loop()` where possible.  This change is needed
because CPython 3.12 deprecated the `get_event_loop()` function.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 13:56:55 +10:00
Damien George
1ea06b99d8 tests/extmod: Fix regex strings to be of r"" type.
Otherwise escape characters like \s and \W won't work correctly.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 13:56:55 +10:00
Damien George
5d07d0c7b0 tests/run-natmodtests.py: Fix search for supported native tests.
Signed-off-by: Damien George <damien@micropython.org>
2024-05-27 11:44:54 +10:00
Brian Pugh
c624a5c0c4 py/dynruntime: Export mp_load_method_maybe and mp_arg_parse_all* funcs.
Also define `mp_type_bytearray`.  These all help to write native modules.

Signed-off-by: Brian Pugh <bnp117@gmail.com>
Signed-off-by: Damien George <damien@micropython.org>
2024-05-24 13:50:57 +10:00
Dan Halbert
40e4e97368 Merge branch '9.0.x' of https://github.com/adafruit/circuitpython into 9.0.5-merge-to-main 2024-05-22 10:18:56 -04:00
49cbbd198a Fix chaining non-built-in exceptions 2024-05-21 16:41:39 -04:00
41eee0d5ea Add tests for chained exceptions (failing) 2024-05-21 16:41:39 -04:00
Damien George
cfd5a8ea3a webassembly/proxy_c: Return undefined if dict lookup failed on JS side.
Instead of raising KeyError.  These semantics match JavaScript behaviour
and make it much more seamless to pass Python dicts through to JavaScript
as though they were JavaScript {} objects.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-16 12:49:42 +10:00
Damien George
aa2e3880c1 webassembly/proxy_js: Create a special "undefined" type for Python.
This adds a new undefined singleton to Python, that corresponds directly to
JavaScript `undefined`.  It's accessible via `js.undefined`.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-16 12:49:10 +10:00
Damien George
0148bbb495 webassembly/proxy_js: Revert back to converting Py None to JS null.
This reverts part of commit fa23e4b093, to
make it so that Python `None` converts to JavaScript `null` (and JavaScript
`null` already converts to Python `None`).  That's consistent with how the
`json` module converts these values back and forth.

Signed-off-by: Damien George <damien@micropython.org>
2024-05-16 12:44:43 +10:00
9e878f7b3d synthio: Calculate LFO.value at construction
Originally, the only (non-debug) way to make an LFO calculate its value
was to associate it with a playing synthesizer.

This posed a problem for LFOs that had "power on values" other than 0,
and where the value was used other than to internally drive a note
property.

Now, an initial, possibly non-zero value is calculated at object
construction time:

```py
>>> l = synthio.LFO(offset = 1)
>>> l.value
1.0
```

Note that this happens just once at construction; it does not happen when
updating LFO properties:
```py
>>> l.offset = 2
>>> l.value
1.0
```
2024-05-14 18:27:57 -05:00
Damien George
025d10a702 tests/micropython/import_mpy_invalid.py: Skip if target cant import mpy.
Signed-off-by: Damien George <damien@micropython.org>
2024-05-14 16:02:30 +10:00
Damien George
154d602b6e webassembly/mpconfigport: Enable importing of .mpy files.
Signed-off-by: Damien George <damien@micropython.org>
2024-05-14 15:19:27 +10:00