Fix regression with pytest.warns using custom warning subclasses which have more than one parameter in their __init__.