micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

unittest: fix context manager to store exception for later retrieval

Open oliver-joos opened this issue 8 years ago • 0 comments

The statement "with assertRaises(errtype) as ctxt" checks the type of a raised exception, but did not store the exception into ctxt like unittest of CPython. The exception instance is usually used to check its message or other args.

This commit is a one-line fix at the cost of a bit more RAM usage while running unittests.

oliver-joos avatar May 14 '18 22:05 oliver-joos