Negative match
Hi,
is there an elegant way to achieve negative match with pytest_httpx? For instance, verify that a header is not present in the request?
A workaround might involve copying existing add_response and modifying it by adding custom assertions in the callback, but I don't feel good about it.
Hello, there is currently no way of doing response matching based on the fact that a header key does not exists. To check this, you currently need to get the request(s) afterwards and assert that the header key is not present yourself.
This is however something I wouldn't mind adding as a feature, I would need to think of something clean to specify this as people would want to match on value being different as well.
Maybe a general custom matcher, defined as a user-defined callable which accepts httpx.Request?