Skip to content

Commit e4cf095

Browse files
committed
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>
1 parent 0104788 commit e4cf095

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python-stdlib/unittest/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
metadata(version="0.10.3")
1+
metadata(version="0.10.4")
22

33
package("unittest")

python-stdlib/unittest/unittest/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def assertRaises(self, exc, func=None, *args, **kwargs):
198198
except Exception as e:
199199
if isinstance(e, exc):
200200
return
201-
raise
201+
raise e
202202

203203
assert False, "%r not raised" % exc
204204

@@ -407,7 +407,7 @@ def run_one(test_function):
407407
current_test=(name, c), test_result=test_result, exc_info=(type(ex), ex, None)
408408
)
409409
# Uncomment to investigate failure in detail
410-
# raise
410+
# raise ex
411411
finally:
412412
__test_result__ = None
413413
__current_test__ = None

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy