def METHOD_NAME(self, registry, serializer):
    with pytest.raises(DuplicateEntryError) as e:
        @registry.register_serializer(MyObj)
        class MyDummySerializer(IDictSerializer):
            def serialize(self, obj: MyObj):
                ...
            def deserialize(self, dct):
                ...