Message404999
The requirement comes from Hypothesis, see
https://github.com/python/cpython/pull/28569#discussion_r730338369
It is necessary there to add a note to an exception describing which test case it comes from. The note should be printed by __str__ of this exception.
class Explanation(Exception):
__module__ = "builtins"
def __str__(self) -> str:
return f"\n{self.args[0]}"
try:
why = "Failed!"
raise AssertionError(why)
except Exception as e:
msg = " You can reproduce this error by ...\n ..."
raise Explanation(msg) from e
# Ideally something more like:
e.__note__ = msg
raise |
|
Date |
User |
Action |
Args |
2021-10-25 20:38:01 | iritkatriel | set | recipients:
+ iritkatriel |
2021-10-25 20:38:01 | iritkatriel | set | messageid: <1635194281.32.0.0583100270803.issue45607@roundup.psfhosted.org> |
2021-10-25 20:38:01 | iritkatriel | link | issue45607 messages |
2021-10-25 20:38:01 | iritkatriel | create | |
|