@@ -43,11 +43,16 @@ unwinds. Several real world use cases are listed below.
4343 issue how to aggregate these errors, particularly when they are different
4444 [[ Python issue 29980] ( https://bugs.python.org/issue29980 )] .
4545
46- * ** Multiple user callbacks fail.** The pytest library allows users to register
47- finalizers which are executed at teardown. If more than one of these
48- finalizers raises an exception, only the first is reported to the user. This
49- can be improved with ` ExceptionGroup ` s, as explained in this issue by pytest
50- developer Ran Benita [[ Pytest issue 8217] ( https://github.com/pytest-dev/pytest/issues/8217 )]
46+ * ** Multiple user callbacks fail.** Python's ` atexit.register() ` allows users
47+ to register functions that are called on system exit. If any of them raise
48+ exceptions, only the last one is reraised, but it would be better to reraised
49+ all of them together
50+ [[ ` atexit ` documentation] ( https://docs.python.org/3/library/atexit.html#atexit.register )] .
51+ Similarly, the pytest library allows users to register finalizers which
52+ are executed at teardown. If more than one of these finalizers raises an
53+ exception, only the first is reported to the user. This can be improved with
54+ ` ExceptionGroup ` s, as explained in this issue by pytest developer Ran Benita
55+ [[ Pytest issue 8217] ( https://github.com/pytest-dev/pytest/issues/8217 )]
5156
5257* ** Multiple errors in a complex calculation.** The Hypothesis library performs
5358 automatic bug reduction (simplifying code that demonstrates a bug). In the
@@ -1051,6 +1056,10 @@ specified in the same place where we state `T`.
10511056
10521057 https://bugs.python.org/issue40857
10531058
1059+ * ` atexit ` documentation:
1060+
1061+ https://docs.python.org/3/library/atexit.html#atexit.register
1062+
10541063* PyTest issue 8217: Improve reporting when multiple teardowns raise an exception
10551064
10561065 https://github.com/pytest-dev/pytest/issues/8217
0 commit comments