Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from Zac-HD/use-exceptiongroup
Use `ExceptionGroup` and fix magic-exception handling
- Loading branch information
Showing
7 changed files
with
104 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
If a test raises an ``ExceptionGroup`` (or nested ``ExceptionGroup``\ s) with only | ||
a single 'leaf' exception from ``pytest.xfail()`` or ``pytest.skip()``\ , we now | ||
unwrap it to have the desired effect on Pytest. ``ExceptionGroup``\ s with two or | ||
more leaf exceptions, even of the same type, are not changed and will be treated | ||
as ordinary test failures. | ||
|
||
See `pytest-dev/pytest#9680 <https://github.com/pytest-dev/pytest/issues/9680>`__ | ||
for design discussion. This feature is particularly useful if you've enabled | ||
`the new strict_exception_groups=True option | ||
<https://trio.readthedocs.io/en/stable/reference-core.html#strict-versus-loose-exceptiongroup-semantics>`__. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Trio 0.22.0 deprecated ``MultiError`` in favor of the standard-library | ||
(or `backported <https://pypi.org/project/exceptiongroup/>`__) ``ExceptionGroup`` | ||
type; ``pytest-trio`` now uses ``ExceptionGroup`` and therefore requires | ||
Trio 0.22.0 or later. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
[pytest] | ||
addopts = -ra -v --pyargs pytest_trio --verbose --cov | ||
filterwarnings = | ||
error | ||
default::pytest.PytestAssertRewriteWarning | ||
default::pytest.PytestDeprecationWarning | ||
default::pytest.PytestUnraisableExceptionWarning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters