<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/tests/basics, branch 6.1.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.1.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-10-11T06:39:32+00:00</updated>
<entry>
<title>update async tests with less upython workaround and more cpython compatibility</title>
<updated>2020-10-11T06:39:32+00:00</updated>
<author>
<name>Kenny</name>
<email>3454741+WarriorOfWire@users.noreply.github.com</email>
</author>
<published>2020-10-11T06:39:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=98aa4b794346161e512d0fba913901021dd2cfbf'/>
<id>urn:sha1:98aa4b794346161e512d0fba913901021dd2cfbf</id>
<content type='text'>
</content>
</entry>
<entry>
<title>modstruct: Improve compliance with python3</title>
<updated>2020-09-12T19:07:23+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-09-12T18:57:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=54d97251fe2dd4939652a186bf703885e654b4d1'/>
<id>urn:sha1:54d97251fe2dd4939652a186bf703885e654b4d1</id>
<content type='text'>
While checking whether we can enable -Wimplicit-fallthrough, I encountered
a diagnostic in mp_binary_set_val_array_from_int which led to discovering
the following bug:
```
&gt;&gt;&gt; struct.pack("xb", 3)
b'\x03\x03'
```
That is, the next value (3) was used as the value of a padding byte, while
standard Python always fills "x" bytes with zeros.  I initially thought
this had to do with the unintentional fallthrough, but it doesn't.
Instead, this code would relate to an array.array with a typecode of
padding ('x'), which is ALSO not desktop Python compliant:
```
&gt;&gt;&gt; array.array('x', (1, 2, 3))
array('x', [1, 0, 0])
```
Possibly this is dead code that used to be shared between struct-setting
and array-setting, but it no longer is.

I also discovered that the argument list length for struct.pack
and struct.pack_into were not checked, and that the length of binary data
passed to array.array was not checked to be a multiple of the element
size.

I have corrected all of these to conform more closely to standard Python
and revised some tests where necessary.  Some tests for micropython-specific
behavior that does not conform to standard Python and is not present
in CircuitPython was deleted outright.
</content>
</entry>
<entry>
<title>core: add int.bit_length() when MICROPY_CYPTHON_COMPAT is enabled</title>
<updated>2020-09-06T14:53:16+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-04-28T14:13:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=20c2dd0c0853f3f1f6a5fa23887f08ec5cf77818'/>
<id>urn:sha1:20c2dd0c0853f3f1f6a5fa23887f08ec5cf77818</id>
<content type='text'>
This method of integer objects is needed for a port of python3's
decimal.py module.

MICROPY_CPYTHON_COMPAT is enabled by CIRCUITPY_FULL_BUILD.
</content>
</entry>
<entry>
<title>py/compile: Don't await __aiter__ special method in async-for.</title>
<updated>2020-07-25T05:55:37+00:00</updated>
<author>
<name>Jonathan Hogg</name>
<email>me@jonathanhogg.com</email>
</author>
<published>2020-07-21T17:47:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=901f3dce6e5e7c1501550ca0b7f3283848194a2e'/>
<id>urn:sha1:901f3dce6e5e7c1501550ca0b7f3283848194a2e</id>
<content type='text'>
MicroPython's original implementation of __aiter__ was correct for an
earlier (provisional) version of PEP492 (CPython 3.5), where __aiter__ was
an async-def function.  But that changed in the final version of PEP492 (in
CPython 3.5.2) where the function was changed to a normal one.  See
https://www.python.org/dev/peps/pep-0492/#why-aiter-does-not-return-an-awaitable
See also the note at the end of this subsection in the docs:
https://docs.python.org/3.5/reference/datamodel.html#asynchronous-iterators
And for completeness the BPO: https://bugs.python.org/issue27243

To be consistent with the Python spec as it stands today (and now that
PEP492 is final) this commit changes MicroPython's behaviour to match
CPython:  __aiter__ should return an async-iterable object, but is not
itself awaitable.

The relevant tests are updated to match.

See #6267.
</content>
</entry>
<entry>
<title>add coroutine behavior for generators</title>
<updated>2020-07-24T03:40:16+00:00</updated>
<author>
<name>Kenny</name>
<email>3454741+WarriorOfWire@users.noreply.github.com</email>
</author>
<published>2020-07-21T07:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=51a79b1af7fa663bb078136611705c04df12970a'/>
<id>urn:sha1:51a79b1af7fa663bb078136611705c04df12970a</id>
<content type='text'>
coroutines don't have __next__; they also call themselves coroutines.
This does not change the fact that `async def` methods are generators,
but it does make them behave more like CPython.
</content>
</entry>
<entry>
<title>Fix up end of file and trailing whitespace.</title>
<updated>2020-06-03T09:56:35+00:00</updated>
<author>
<name>Diego Elio Pettenò</name>
<email>flameeyes@flameeyes.com</email>
</author>
<published>2020-05-30T09:44:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dd5d7c86d22807c021dd1711eb7dd3daebc5cfcf'/>
<id>urn:sha1:dd5d7c86d22807c021dd1711eb7dd3daebc5cfcf</id>
<content type='text'>
This can be enforced by pre-commit, but correct it separately to make it easier to review.
</content>
</entry>
<entry>
<title>tests: Add .exp files for basics/parser and import/import_override.</title>
<updated>2020-04-01T21:31:33+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2019-12-13T02:49:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=aa10e5c3343d0947eb5a813e8a5025205dc1efd4'/>
<id>urn:sha1:aa10e5c3343d0947eb5a813e8a5025205dc1efd4</id>
<content type='text'>
Because CPython 3.8.0 now produces different output:
- basics/parser.py: CPython does not allow '\\\n' as input.
- import/import_override: CPython imports _io.
</content>
</entry>
<entry>
<title>tests/basics: Provide .exp files for generator tests that fail PEP479.</title>
<updated>2020-03-31T22:27:10+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-08-17T05:50:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=764e65fb11ab6aa80c540a8f9d15237f406d62fd'/>
<id>urn:sha1:764e65fb11ab6aa80c540a8f9d15237f406d62fd</id>
<content type='text'>
PEP479 (see https://www.python.org/dev/peps/pep-0479/) prohibited raising
StopIteration from within a generator (it is turned into a RuntimeError).
This behaviour was introduced in Python 3.5 and in 3.7 was made compulsory.
Until uPy implements PEP479, this patch adds .py.exp files for the relevant
tests so they can be run under Python 3.7.
</content>
</entry>
<entry>
<title>tests: Modify tests that print repr of an exception with 1 arg.</title>
<updated>2020-03-31T22:27:10+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-08-17T05:46:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8f0147cf00e3fa8db283adbd1698c60fbe76a62a'/>
<id>urn:sha1:8f0147cf00e3fa8db283adbd1698c60fbe76a62a</id>
<content type='text'>
In Python 3.7 the behaviour of repr() of an exception with one argument
changed: it no longer prints a trailing comma in the argument list.  See
https://bugs.python.org/issue30399

This patch modifies tests that rely on this behaviour to not rely on it.
And the python34.py test is updated to include a test for this behaviour
with a .exp file.
</content>
</entry>
<entry>
<title>tests/basics/int_big_error.py: Use bytearray to test for int overflow.</title>
<updated>2020-03-31T22:27:10+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-08-17T05:43:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4c4f81f8f2f68a5dc47d37ba185a2506224d7159'/>
<id>urn:sha1:4c4f81f8f2f68a5dc47d37ba185a2506224d7159</id>
<content type='text'>
In Python 3.7 "1 &gt;&gt; (big int)" is now allowed, it no longer raises an
OverflowError.  So use bytearray to test big-int conversion overflow.
</content>
</entry>
</feed>
