bpo-36829: Add test.support.catch_unraisable_exception() by vstinner · Pull Request #13490 · python/cpython

@vstinner

* Copy test_exceptions.test_unraisable() to
  test_sys.UnraisableHookTest().
* test_exceptions.test_unraisable() uses catch_unraisable_exception();
  simplify the test. test_sys now checks the exact output.
* Use catch_unraisable_exception() in test_coroutines,
  test_exceptions, test_generators.

vstinner

graingert

Avoid the need for try/finally: __exit__ clears unraisable to break
the reference cycle.

@vstinner

@vstinner vstinner deleted the catch_unraisable_exception branch

May 22, 2019 21:44