I am working with Schemathesis and pytest. I came across with a problem of serializing 'application/xml' content-type as Schemathesis can't do it out of the box. However, it allows to create a custom serializer to process any content type according to their documentation.
Once I created a serializer I noticed that Schemathesis does not see it. I don't understand what's wrong with it and unfortunately there is not much information about it.
Here is the example:
import schemathesis
@schemathesis.serializers.register("application/xml")
class XmlSerializer:
def as_requests(self, context, payload):
print("as_requests")
return {"data": "someData"}
def as_werkzeug(self, context, payload):
print("as_werkzeug")
return {"data": "someData"}
When I put a breakpoint, it doesn't stop on it and it does not print the values. I would appreciate if you can help me to figure out what is wrong here.