Skip to content

Commit

Permalink
unittest: Always use "raise" with an argument.
Browse files Browse the repository at this point in the history
So this code can be compiled with the MicroPython native emitter, which
does not support "raise" without any arguments.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Nov 18, 2024
1 parent 0104788 commit e4cf095
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python-stdlib/unittest/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metadata(version="0.10.3")
metadata(version="0.10.4")

package("unittest")
4 changes: 2 additions & 2 deletions python-stdlib/unittest/unittest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def assertRaises(self, exc, func=None, *args, **kwargs):
except Exception as e:
if isinstance(e, exc):
return
raise
raise e

assert False, "%r not raised" % exc

Expand Down Expand Up @@ -407,7 +407,7 @@ def run_one(test_function):
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
Expand Down

0 comments on commit e4cf095

Please sign in to comment.