File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ def set_specification(
338
338
spec_opts : "_HookSpecOpts" ,
339
339
) -> None :
340
340
if self .spec is not None :
341
- raise RuntimeError (
341
+ raise ValueError (
342
342
f"Hook { self .spec .name !r} is already registered "
343
343
f"within namespace { self .spec .namespace } "
344
344
)
Original file line number Diff line number Diff line change @@ -419,5 +419,9 @@ def conflict(self) -> None:
419
419
pass
420
420
421
421
pm .add_hookspecs (Api1 )
422
- with pytest .raises (RuntimeError ) :
422
+ with pytest .raises (ValueError ) as exc :
423
423
pm .add_hookspecs (Api2 )
424
+ assert str (exc .value ) == (
425
+ "Hook 'conflict' is already registered within namespace "
426
+ "<class 'test_hookcaller.test_hook_conflict.<locals>.Api1'>"
427
+ )
You can’t perform that action at this time.
0 commit comments