Wykres commitów

29 Commity (1b46612f941ce96800af57d82e59d16750943284)

Autor SHA1 Wiadomość Data
Paul Sokolovsky 1b46612f94 unittest: Implement basic addCleanup()/doCleanup().
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 2c0b508e4d unittest: TestSuite: Add run() method.
For CPython compatibility.

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 04dce89790 unittest: Add dummy TestCase.assertWarns() context manager.
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 555f28ce6d unittest: Add dummy TestCase.subTest() context manager.
Just runs "subtests" in the scope of the main TestCase.

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 7d77774027 unittest: Add TestCase.skipTest() method.
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 5d3a44cb1c unittest: TestCase: Add (dummy) __init__.
Mostly to workaround inherited MicroPython's issues with inheritance.

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky f09d2ec608 unittest: Support both test classes and class instances.
And for clarity, rename runner function run_class() -> run_suite().

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky d747b21fc6 unittest: Only treat callable fields as test methods.
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky c72ec5c029 unittest: TestSuite: Add undescore to internal field, self._tests.
To avoid possible name clashes.

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky dc788f4e50 unittest: Reinstate useful debugger helper.
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
2022-05-06 10:47:37 +10:00
Paul Sokolovsky dedfe2dcd4 unittest: Add assertLessEqual, assertGreaterEqual methods.
As used by CPython testsuite.
2022-05-06 10:47:37 +10:00
Paul Sokolovsky a57b575020 unittest: AssertRaisesContext: Store exception value as self.exception.
For tests to check. This feature is used by CPython stdlib tests.
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 965e25ce89 unittest: test_unittest: Typo fix. 2022-05-06 10:47:37 +10:00
Paul Sokolovsky fca89f65c7 unittest: test_unittest: Add test for .assertRaises(AssertionError).
Make sure that not raising AssertionError from tested function is properly
caught.
2022-05-06 10:47:37 +10:00
sss 669d343feb unittest: Allow to catch AssertionError with assertRaises().
Without this change, current implementaiton produces a false positive
result for AssertionError type.

Example of falsely passing test code:

def test(a, b):
    assert a > 10
    assert b > 10

self.assertRaises(AssertionError, test, 20, 20)
2022-05-06 10:47:37 +10:00
Paul Sokolovsky 663a3d6c54 unittest: test_unittest.py: Fix typo in method name. 2022-05-06 10:47:37 +10:00
Andrew Leech 7d4d02edfc unittest: Log failure tracebacks at test end.
Store traceback details for each test failure and log to console at the
end of the test, like CPython version of the module does.
2022-05-06 10:47:37 +10:00
Andrew Leech a9cd99ce2d unittest: Allow passing module name or instance into unittest.main() 2022-05-06 10:47:37 +10:00
Andrew Leech d64557a211 fnmatch: Release 0.6.0. 2022-05-06 10:47:37 +10:00
Andrew Leech 7259f0fd6f fnmatch: Remove dependency on os.path. 2022-05-06 10:47:37 +10:00
Andrew Leech dcdac1f552 fnmatch: Add ure compatibility.
Removes dependency on re-pcre which is only available on unix port.
2022-04-08 16:16:56 +10:00
Lorenzo Cappelletti fc86070ffb python-stdlib/datetime: Add new implementation of datetime module.
This new module is a port of Python datetime providing classes for
manipulating dates, times, and deltas.  It completely replaces the existing
unix-ffi version.

Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
2022-03-22 14:02:01 +11:00
Damien George 64b8817c0d all: Update formatting for new Black version 22.1.0.
Signed-off-by: Damien George <damien@micropython.org>
2022-03-22 13:30:34 +11:00
Damien George a3df207934 python-stdlib/random: Add getrandbits with no limit on number of bits.
Thanks to Macarthur Inbody aka @133794m3r for the implementation.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-30 16:04:17 +10:00
Damien George f7f38ff2f1 python-stdlib/cgi: Apply Black formatting.
Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 22:42:47 +10:00
Jim Mussared 35e3c9e4ff python-ecosys: Move urequests to python-ecosys.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-27 16:53:02 +10:00
Jim Mussared fa13cbbc8b all: Run black over all code.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-05-27 15:50:04 +10:00
Jim Mussared af3e1aff9e all: Update READMEs. 2021-05-27 15:41:08 +10:00
Jim Mussared 1a28fe84e8 top: Move modules into python-stdlib, unix-ffi, or micropython. 2021-05-27 15:41:08 +10:00