unittest: Always use "raise" with an argument.

So this code can be compiled with the MicroPython native emitter, which
does not support "raise" without any arguments.

Signed-off-by: Damien George <damien@micropython.org>
pull/937/head
Damien George 2024-11-18 12:00:38 +11:00
rodzic 01047889eb
commit e4cf09527b
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -1,3 +1,3 @@
metadata(version="0.10.3")
metadata(version="0.10.4")
package("unittest")

Wyświetl plik

@ -198,7 +198,7 @@ class TestCase:
except Exception as e:
if isinstance(e, exc):
return
raise
raise e
assert False, "%r not raised" % exc
@ -407,7 +407,7 @@ def _run_suite(c, test_result: TestResult, suite_name=""):
current_test=(name, c), test_result=test_result, exc_info=(type(ex), ex, None)
)
# Uncomment to investigate failure in detail
# raise
# raise ex
finally:
__test_result__ = None
__current_test__ = None