File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 76
76
PosArgT = TypeVarTuple ("PosArgT" )
77
77
StatusT = TypeVar ("StatusT" , default = None )
78
78
StatusT_contra = TypeVar ("StatusT_contra" , contravariant = True , default = None )
79
+ BaseExcT = TypeVar ("BaseExcT" , bound = BaseException )
79
80
else :
80
81
from typing import TypeVar
81
82
@@ -130,8 +131,9 @@ def _hypothesis_plugin_setup() -> None: # pragma: no cover
130
131
131
132
import trio .testing ._raises_group
132
133
133
- def repr_callable (fun : Callable [[BaseException ], bool ]) -> str :
134
- return "'" + get_pretty_function_description (fun ) + "'"
134
+ def repr_callable (fun : Callable [[BaseExcT ], bool ]) -> str :
135
+ # add quotes around the signature
136
+ return repr (get_pretty_function_description (fun ))
135
137
136
138
trio .testing ._raises_group .repr_callable = repr_callable
137
139
except ImportError :
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ def _match_pattern(match: Pattern[str]) -> str | Pattern[str]:
161
161
return match .pattern if match .flags == _REGEX_NO_FLAGS else match
162
162
163
163
164
- def repr_callable (fun : Callable [[BaseException ], bool ]) -> str :
164
+ def repr_callable (fun : Callable [[BaseExcT_1 ], bool ]) -> str :
165
165
"""Get the repr of a ``check`` parameter.
166
166
167
167
Split out so it can be monkeypatched (e.g. by our hypothesis plugin)
You can’t perform that action at this time.
0 commit comments