Traceback (most recent call last):
File "c:\Users\Peter\Documents\work\ensure_try\.venv\Lib\site-packages\ensure\main.py", line 71, in _run
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "c:\python312\Lib\unittest\case.py", line 885, in assertEqual
assertion_func(first, second, msg=msg)
File "c:\python312\Lib\unittest\case.py", line 878, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 1 != 2
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\Peter\Documents\work\ensure_try\hello.py", line 9, in <module>
main()
File "c:\Users\Peter\Documents\work\ensure_try\hello.py", line 5, in main
ensure(1).equals(2)
File "c:\Users\Peter\Documents\work\ensure_try\.venv\Lib\site-packages\ensure\main.py", line 205, in equals
self._run(unittest_case.assertEqual, (self._subject, other))
File "c:\Users\Peter\Documents\work\ensure_try\.venv\Lib\site-packages\ensure\main.py", line 74, in _run
raise new_err
ensure.main.EnsureError: 1 != 2
I would like to see only the second, as the first is only internal detail.
Hi, ensure looks promising!
However, I have tried the simplest failure of
ensure(1).equals(2)and my script showed two exceptions:I would like to see only the second, as the first is only internal detail.
I think in
main.pyline 74 you would needraise new_err from Noneinstead ofraise new_err.