Damien George
f69ab79ec8
py/objgenerator: Allow to hash generators and generator instances.
...
Adds nothing to the code size, since it uses existing empty slots in the
type structures.
2017-07-07 11:47:38 +10:00
Paul Sokolovsky
ed52955c6b
tests/cpydiff/modules_deque: Elaborate workaround.
2017-07-05 23:03:37 +03:00
Krzysztof Blazewicz
7feb7301b2
tests/basics: Add tests for arithmetic operators precedence.
2017-07-05 15:51:03 +10:00
Damien George
6b8b56f859
py/modmath: Check for zero division in log with 2 args.
2017-07-04 02:15:11 +10:00
Damien George
b86c65d31c
extmod/modubinascii: Add check for empty buffer passed to hexlify.
...
Previous to this patch hexlify(b'', b':') would lead to a bad crash due to
the computed length of the result being -1=0xffffffff.
2017-07-03 14:52:00 +10:00
Paul Sokolovsky
58b7b01cb5
extmod/modure: If input string is bytes, return bytes results too.
...
This applies to match.group() and split().
For ARM Thumb2, this increased code size by 12 bytes.
2017-07-01 01:25:45 +03:00
Damien George
369e7fd178
tests/unix/extra_coverage: Add test for mp_vprintf with bad fmt spec.
2017-06-30 12:25:42 +10:00
Damien George
8f6ef8de48
tests/basics/namedtuple1: Add test for creating with pos and kw args.
2017-06-29 17:50:09 +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
4a6c0fda78
tests: Auto detect floating point capabilites of the target.
...
The floating-point precision of the target is detected (0, 30, 32 or 64)
and only those tests which can run on the target will be run.
2017-06-26 13:47:00 +10:00
Paul Sokolovsky
bc7659eb59
tests/connect_nonblock: Refactor towards real net_hosted test.
...
In the future, a special runner for such tests will import each test and
call test() function with an address of test server to use.
2017-06-23 21:27:05 +03:00
Paul Sokolovsky
3f9d59c87a
tests/net_inet: Move tests which don't require full Internet to net_hosted.
...
The idea is that these tests can be run with just a test server running
on a test host, with device under test connecting to it, instead of
requiring Internet connection for testing.
Such setup is however WIP, and some tests in net_hosted/ are so far
written to connect to Internet, as there're not test server written
yet. This is expected to evolve over time.
2017-06-23 21:12:32 +03:00
Damien George
44922934f5
tests/basics: Add tests for for-else statement.
2017-06-22 14:02:14 +10:00
Damien George
458cbacb8f
tests/net_inet: Add tests for accept and connect in nonblocking mode.
...
Some of these tests don't require an Internet connection, but here is a
good place to put them for now.
2017-06-21 12:25:10 +10:00
Paul Sokolovsky
4caa27ae0e
tests/net_inet/test_tls_sites.py: Integration test for SSL connections.
...
This attempts to bootstrap network tests for MicroPython. This commits
sets test/net_inet/ as place for tests which require access to wide
Internet. They aren't intended to be run as part of the main testsuite,
instead to be run manually on demand.
test_tls_sites.py in particular check that it's possible to establish
SSL/TLS connection to select sites on the Internet: few references ones,
plus those for which problems were reported, and resolved.
2017-06-21 01:58:36 +03:00
Damien George
e269cabe3e
py/objint: In to_bytes(), allow length arg to be any int and check sign.
2017-06-15 14:21:02 +10:00
Damien George
8c5632a869
py/objint: Support "big" byte-order in int.to_bytes().
2017-06-15 13:56:21 +10:00
Damien George
1e70fda69f
py/compile: Raise SyntaxError if positional args are given after */**.
...
In CPython 3.4 this raises a SyntaxError. In CPython 3.5+ having a
positional after * is allowed but uPy has the wrong semantics and passes
the arguments in the incorrect order. To prevent incorrect use of a
function going unnoticed it is important to raise the SyntaxError in uPy,
until the behaviour is fixed to follow CPython 3.5+.
2017-06-14 18:18:01 +10:00
Damien George
e374cfff80
py/modthread: Raise RuntimeError in release() if lock is not acquired.
2017-06-14 14:43:50 +10:00
Damien George
6ed4581f54
py/formatfloat: Fix number of digits and exponent sign when rounding.
...
This patch fixes 2 things when printing a floating-point number that
requires rounding up of the mantissa:
- retain the correct precision; eg 0.99 becomes 1.0, not 1.00
- if the exponent goes from -1 to 0 then render it as +0, not -0
2017-06-13 13:36:56 +10:00
Damien George
f55dcddbc7
tests/extmod/vfs_basic: Allow test to pass on embedded targets.
2017-06-11 22:56:27 +10:00
Paul Sokolovsky
85d809d1f4
tests: Convert remaining "sys.exit()" to "raise SystemExit".
2017-06-10 20:34:38 +03:00
Paul Sokolovsky
a2803b74f4
tests/basics: Convert "sys.exit()" to "raise SystemExit".
2017-06-10 20:03:01 +03:00
Paul Sokolovsky
07241cd37a
py/objstringio: If created from immutable object, follow copy on write policy.
...
Don't create copy of immutable object's contents until .write() is called
on BytesIO.
2017-06-09 17:33:01 +03:00
Paul Sokolovsky
e094200750
tests/float/builtin_float_minmax: PEP8 fixes.
2017-06-08 17:23:22 +03:00
Damien George
fde54350a8
tests/float: Convert "sys.exit()" to "raise SystemExit".
...
The latter is shorter and simpler because it doesn't require importing the
sys module.
2017-06-08 14:00:57 +10:00
Damien George
f6ef8e3f17
extmod/vfs: Allow to statvfs the root directory.
2017-06-07 15:17:45 +10:00
Damien George
7400d88762
tests/basics/string_rsplit: Add tests for negative "maxsplit" argument.
2017-06-02 13:08:18 +10:00
Ville Skyttä
ca16c38210
various: Spelling fixes
2017-05-29 11:36:05 +03:00
Damien George
8b13cd7e19
tests/basics: Add more tests for unwind jumps from within a try-finally.
...
These tests excercise cases that are fixed by the previous two commits.
2017-05-25 20:48:16 +10:00
Damien George
218a876f97
tests/basics/builtin_range: Add tests for negative slicing of range.
2017-05-18 17:32:42 +10:00
Damien George
e1b0f2a16f
tests/basics/list_slice_3arg: Add more tests for negative slicing.
2017-05-18 17:32:42 +10:00
Tom Collins
162a0f942b
tests/io/bytesio_ext: Test read() after seek() past end of BytesIO object.
2017-05-15 23:58:06 +03:00
Paul Sokolovsky
054a381d7c
tests/extmod/vfs_fat_more: Make skippable is uos is not available.
...
Fixes Zephyr tests.
2017-05-13 14:13:53 +03:00
Damien George
cda09727b4
tests/extmod/vfs_fat: Add test for ilistdir of a non-existent directory.
2017-05-13 19:10:15 +10:00
Tom Collins
760aa0996f
tests/basics/lexer: Add line continuation tests for lexer.
...
Tests for an issue with line continuation failing in paste mode due to the
lexer only checking for \n in the "following" character position, before
next_char() has had a chance to convert \r and \r\n to \n.
2017-05-12 15:14:25 +10:00
Damien George
852c215d76
tests/extmod/vfs: Update tests to reflect new ilistdir() method.
2017-05-10 11:39:29 +10:00
Damien George
9bd67d9fbc
tests/extmod: Make some vfs tests fully unmount FSs before running.
...
Otherwise the existing FSs can interfere with the tests, and in some
cases the tests can write to the real FS on the device.
2017-05-09 15:50:40 +10:00
Tom Collins
d00d062af2
tests/basics/lexer: Add lexer tests for input starting with newlines.
2017-05-09 14:48:00 +10:00
Damien George
e711e2d44a
tests/basics: Add memoryview test for big ints.
2017-05-09 10:49:19 +10:00
Damien George
2e9e14980d
tests/basics: Update array test for big-int with lL typecodes.
2017-05-09 10:46:43 +10:00
Paul Sokolovsky
4a4490ffcc
py/modio: resource_stream: Implement "package" param handling.
2017-05-06 18:42:35 +03:00
Damien George
084824f866
tests: Move super-as-local test from cpydiff to basic tests.
...
It's now possible to use the name "super" as a local variable.
2017-05-06 11:01:57 +10:00
Damien George
dce7dd4259
tests/micropython: Add test for int.from_bytes with many zero bytes.
2017-05-06 10:29:09 +10:00
Damien George
1b3e372418
tests/extmod: Add some more VFS tests.
2017-05-05 20:15:10 +10:00
Damien George
6c8b57a902
tests/extmod: Add more tests for VFS FAT.
2017-05-05 20:15:10 +10:00
Paul Sokolovsky
12ea06567c
tests/cpydiff/core_function_unpacking: Fill in workaround.
2017-05-04 00:48:48 +03:00
Paul Sokolovsky
92657c671f
tests/cpydiff/core_import_split_ns_pkgs: Test for split namespace packages.
2017-05-03 17:16:19 +03:00
Paul Sokolovsky
3923f96dc6
tests/cpydiff/core_import_path: Test showing difference in package.__path__.
2017-05-03 12:22:53 +03:00