You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use Typevar defaults for TaskStatus and Matcher (#3019)
* Default TaskStatus to use None if unspecified
* Default Matcher to BaseException if unspecified
* Update Sphinx logic for new typevar name
* Add some type tests for defaulted typevar classes
# These two typevars are special cased in sphinx config to workaround lookup bugs.
40
+
41
+
ifsys.version_info< (3, 11):
42
+
fromexceptiongroupimportBaseExceptionGroup
35
43
36
44
37
45
@final
38
-
class_ExceptionInfo(Generic[E]):
46
+
class_ExceptionInfo(Generic[MatchE]):
39
47
"""Minimal re-implementation of pytest.ExceptionInfo, only used if pytest is not available. Supports a subset of its features necessary for functionality of :class:`trio.testing.RaisesGroup` and :class:`trio.testing.Matcher`."""
40
48
41
-
_excinfo: tuple[type[E], E, types.TracebackType] |None
"""Helper class to be used together with RaisesGroups when you want to specify requirements on sub-exceptions. Only specifying the type is redundant, and it's also unnecessary when the type is a nested `RaisesGroup` since it supports the same arguments.
140
153
The type is checked with `isinstance`, and does not need to be an exact match. If that is wanted you can use the ``check`` parameter.
141
154
:meth:`trio.testing.Matcher.matches` can also be used standalone to check individual exceptions.
@@ -154,10 +167,10 @@ class Matcher(Generic[E]):
154
167
# At least one of the three parameters must be passed.
0 commit comments