Colin-b/pytest_httpx

add_callback is no longer valid method to raise exception.

Closed this issue · 1 comments

Since version 0.16.0 method add_callback has been requiring callback with httpx.Response return value. If we create callback to only rise exception then return value is None. mypy won't pass with such expected return (I had to ignore triggering add_callback). I know that #10 would probably fix it but maybe You'll find some way to patch it sooner. I could write -> httpx.Response but it just doesn't seem True if all I do in function is raising an exception.

Thanks for reporting, it should be fixed in 0.17.3. Note that I also added the add_exception method, it should help cleanup your code by removing some "useless" function definition