Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.


pytest 7.2.0 introduced the exceptiongroup backport as a dependency for Python < 3.11, which uses sys.excepthook to format ExceptionGroup exceptions.
But Trio 0.21.0 also uses sys.excepthook to format MultiError exceptions (the ancestor of ExceptionGroup). However, since there can only be one exception hook, Trio aborts when it finds the one set by the exceptiongroup backport and raises a warning.
There are three ways to fix this.
triobeforepytestin test_testclient.py, since exceptiongroup does not warn when an exceptiongroup exists. However, messing with isort--topoption sounds confusing.This was discussed here: https://gitter.im/python-trio/general?at=63617d79bad3c737520305af
Closes #1926