STY: use pytest.raises context syntax
xref #24332
@simonjayhawkins : Even though it's just a handful of files, I have to commend the acrobatics you had to do to make this all work. 👍  @gfyoung 

> @simonjayhawkins : Even though it's just a handful of files, I have to commend the acrobatics you had to do to make this all work

Thanks!

this could be because either the error messages should be more consistent, or maybe it would have been better to put the expected error messages in the parametrization. The 'acrobatics' would then be scoped to just the variations due to platform/interpreter/compiler. thanks @simonjayhawkins 