kopia lustrzana https://github.com/micropython/micropython-lib
unittest: AssertRaisesContext: Store exception value as self.exception.
For tests to check. This feature is used by CPython stdlib tests.pull/488/head
rodzic
965e25ce89
commit
a57b575020
|
@ -21,6 +21,7 @@ class AssertRaisesContext:
|
|||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, tb):
|
||||
self.exception = exc_value
|
||||
if exc_type is None:
|
||||
assert False, "%r not raised" % self.expected
|
||||
if issubclass(exc_type, self.expected):
|
||||
|
|
Ładowanie…
Reference in New Issue